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 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...

  • 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.

  • 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...

  • 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

  • Write a c++ code into the given code  to find composite numbers from the given random number...

    Write a c++ code into the given code  to find composite numbers from the given random number list. The composite numbers is only counted once if there is a repeated number. I need to use this code and add on a code to find if the numbers generated is a composite function. Please help #include <cmath> #include <cstdlib> #include <ctime> #include <iostream> #include <vector> using namespace std; int main() {    srand(time(NULL)); int size_of_list = 0; // the number of random...

  • Please write the following code as simple as possible in python: You will need to define...

    Please write the following code as simple as possible in python: You will need to define a function with four arguments. Here is what I used: > def find_matches(file1.txt, output1.txt, strings, value): file1.txt will contain a list of various strings. The program must copy from the first argument, and it should be written in the second argument (the second file, "output1.txt"). The third and fourth arguments will determine which specific strings will be copied over to the second file. For...

  • Write a subroutine code to divide two positive numbers by repeated subtraction method. For exampl...

    Write a subroutine code to divide two positive numbers by repeated subtraction method. For example, to divide 100 over 8 by subtracting 8 from 100 until the reminder be less than 8, then count the times of the subtractions, to give the result. The first number, second number, and then the result locations must follow the calling code. I need the solution using assembly language not java or c++, please..!!!!

  • I need help with the following. I need to write a program code in Java using...

    I need help with the following. I need to write a program code in Java using NetBeans. It is from How to Program Java book Chapter 2. This program should calculate the packing of Candles. First read: The number of candles The number of candles that fit in each case Then calculate and print: The number of full cases The number of candles left over (partial case) If this order is large (more than 5 full cases needed) An extra...

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
ADVERTISEMENT