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
09 Plot Parabola.c
1
/*
2
Plot Parabola.c
3
Plot y = x^2 / 256 the from 0 to 127.
4
*/
5
6
#include "simpletools.h"
// Include simpletools library
7
#include "
badgetools.h
"
// Include badgetools library
8
9
int
x, y;
10
11
void
main
()
// Main function
12
{
13
badge_setup
();
// Call badge setup
14
while
(1)
// Main loop
15
{
16
for
(x = 0; x < 128; x++)
// Count 0 to 127
17
{
18
y = 64 - (x*x/256);
// Calculate y
19
point
(x, y, 1);
// Plot white point
20
pause(2);
// Wait 2 ms
21
}
22
pause(500);
// Wait 5 s
23
for
(x = 127; x > 0; x--)
// Count 127 to 0
24
{
25
y = 64 - (x*x/256);
// Calculate y
26
point
(x, y, 0);
// Plot black point
27
pause(2);
// Wait 2 ms
28
}
29
}
30
}
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