PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
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.
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
badgetools.h
This library provides convenient functions for a variety of Parallax eBadge operations.
Generated on Sat Aug 27 2016 00:58:03 for PropWare by
1.8.12