PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Examples
Badge
01 Display
08 Plot Points.c
1
/*
2
Plot Points.c
3
The point function has parameters of (x, y, color). X increases from
4
0 (left) to 127 (right). Y increases from 0 (top) to 64 (botton). Color
5
is 1 for white, 0 for black.
6
*/
7
8
#include "
simpletools.h
"
// Include simpletools library
9
#include "
badgetools.h
"
// Include badgetools library
10
11
int
x
, y;
// X and Y variables
12
13
void
main
()
// Main function
14
{
15
badge_setup
();
// Call badge setup
16
while
(1)
// Main loop
17
{
18
for
(
x
= 0;
x
<= 120;
x
+=8)
// Count 0 to 120
19
{
20
y = 64 - (
x
/2);
// y = x/2
21
point
(
x
, y, 1);
// Plot white point
22
pause
(20);
// Wait 1/50 s
23
}
24
pause
(500);
// Wait 1/2 s
25
for
(
x
= 120;
x
>= 0;
x
-=8)
// Count in reverse
26
{
27
y = 64 - (
x
/2);
// Same function
28
point
(
x
, y, 0);
// Plot black point
29
pause
(20);
// Wait 1/50 s
30
}
31
pause
(200);
// Wait 1/5 s
32
}
33
}
point
void point(int x, int y, int color)
Plot a point on the oLED screen.
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,...
main
int main(void)
Definition:
GraphicsTest.c:20
badge_setup
int badge_setup(void)
Set up all available badge drivers. Call this function at the start of any given program to allow acc...
Definition:
badgealpha.c:29
x
int x
Definition:
07 Box and Lines.c:13
badgetools.h
This library provides convenient functions for a variety of Parallax eBadge operations.
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17