PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Examples
C Intro
Basics
Repeat While.c
1
/*
2
Repeat While.c
3
4
Keep displaying n = n + 5 every half second while n < 200.
5
6
http://learn.parallax.com/propeller-c-start-simple/code-repeats
7
*/
8
9
#include "
simpletools.h
"
// Include simpletools
10
11
int
main
()
// main function
12
{
13
int
n = 0;
// Declare n, initialize to zero
14
while
(n < 200)
// Repeat while n less than 200
15
{
16
print
(
"n = %d\n"
, n);
// Display name & value of n
17
n = n + 5;
// Add 5 to n each time through
18
pause
(500);
// 0.5 s between repetitions
19
}
20
print
(
"All done!"
);
// Display all done
21
}
pause
void pause(int time)
Delay cog from moving on to the next statement for a certain length of time.
Definition:
libws2812.c:125
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
print
int print(const char *format,...) __attribute__((format(printf
Print format "..." args to the default simple terminal device. The output is limited to 256 bytes.
main
int main(void)
Definition:
GraphicsTest.c:20
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17