Question

This is for the picaxe-28x2, I need to write a code that will send a number...

This is for the picaxe-28x2, I need to write a code that will send a number every second to the terminal. The number will start at 0 and go to 15. Instead of printing 16, the program will start over at 0. The program will continually count from 0 to 15 forever.   

Picaxe 28x2

Picaxe Edior writing in basic.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h> // preprocessor directives used in the syntax of C language to include the header file of stdio.h(for input)

int main()
{
    int i; // i is initialised to integer data type

    while(1){ //this line is used to create the loop infinitely so that it won't stop
        for(i=0;i<=15;i++){ //loop to iterate from 0 to 15
            printf("%d\n",i); // print the numbers
            sleep(1); //this line is used so that each number is displayed on the terminal at every second
        }
    }
  
    return 0;
}

Add a comment
Know the answer?
Add Answer to:
This is for the picaxe-28x2, I need to write a code that will send a number...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I am having a hard time writing an IDLE code (Python 3.7.2) and I need help....

    I am having a hard time writing an IDLE code (Python 3.7.2) and I need help. Here are the parameters. 1. Write a program that will generate a random backpack. This program will have a menu that allows the user to continuously select between generating a new backpack, printing the current backpack, adding a given number of an item, removing a given number of an item or quitting. Every backpack will have a variable number of the following 7 items:...

  • I need this code in Java! Start by read in a number from the user that...

    I need this code in Java! Start by read in a number from the user that is in the range 1-200. If the user inputs a number out of that range, print out: Invalid number, and end the program. Next, If a number is divisible by 3, print Fizz instead If a number is divisible by 5, print Buzz instead If a number is divisible by both 3 and 5, print out FizzBuzz If a number is none of the...

  • I need help in Python. This is a two step problem So I have the code...

    I need help in Python. This is a two step problem So I have the code down, but I am missing some requirements that I am stuck on. Also, I need help verifying the problem is correct.:) 7. Random Number File Writer Write a program that writes a series of random numbers to a file. Each random number should be in the range of 1 through 500. The application should let the user specify how many random numbers the file...

  • I need python help .. I need to know if a user were to input 3...

    I need python help .. I need to know if a user were to input 3 commands to a program and run it such as specify: Usage: ./filemaker INPUTCOMMANDFILE OUTPUTFILE RECORDCOUNT (./filemaker is the program)( (INPUTCOOMANDFUILE= a text file that contains key words that need to be searched through then decided what to do ) (RECORDCOUNT= number) Given an input file that contains the following: That specifies the text, then the output, and the number of times to be repeated...

  • Please write a java program with a input file "jabberwock.txt", and output the "output.txt" with following...

    Please write a java program with a input file "jabberwock.txt", and output the "output.txt" with following requirement. You and your partner will be writing a simple Java program that implements some basic file I/O operations. You can use this code as the basis for some of your next project. FIRST: Write code that prompts the user for the name of a text file, opens that file if it exists and reads the file one line at a time printing each...

  • JavaFX! Just need to fill several lanes of code please!!! CSE205 OOP and Data Structure Quiz #15 Last Name (print) First Name (print) Write a JavaFX GUI application program that simulates a timer. T...

    JavaFX! Just need to fill several lanes of code please!!! CSE205 OOP and Data Structure Quiz #15 Last Name (print) First Name (print) Write a JavaFX GUI application program that simulates a timer. The timer should show "count: the beginning and increase the number by 1 in every one second, and so on. o" at .3 A Timer - × A Timer Count: 0 Count: 1 (B) After 1 second, the GUI Window (A) Initial GUI Window According to the...

  • E2.15 In assembly code, write a program to count the number of elements in an array...

    E2.15 In assembly code, write a program to count the number of elements in an array that are smaller than 16. The array is stored at memory locations starting from $1010. The array has 30 8-bit unsigned elements. Store the count in the memory location $C001.

  • I need help with this. Thank you. Write a chat program to send/receive messages. The messages...

    I need help with this. Thank you. Write a chat program to send/receive messages. The messages will go through a server. The server should be able to handle up to 5 talks at the same time. Each talk will be between 2 clients. The server should log all messages. The project should be written in C and should be work on GNU/Linux systems.

  • Write the pseudo code using modules for the following questions 1.) write pseudo code for a...

    Write the pseudo code using modules for the following questions 1.) write pseudo code for a program that outputs every number from 1 through 20 along with their values doubled and tripled 2.) write pseudo code for a program that outputs every number in reverse order from 25 down to 0

  • Can someone upload a picture of the code in matlab Write a "Guess My Number Game"...

    Can someone upload a picture of the code in matlab Write a "Guess My Number Game" program. The program generates a random integer in a specified range, and the user (the player) has to guess the number. The program allows the use to play as many times as he/she would like; at the conclusion of each game, the program asks whether the player wants to play again The basic algorithm is: 1. The program starts by printing instructions on the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT