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
02 Lights
04 RBG LEDs.c
1
/*
2
RGB LEDs.c
3
Uses rgb(side, color) to control L or R leds, with color options of OFF,
4
BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, and WHITE.
5
*/
6
7
#include "simpletools.h"
// Include simpletools library
8
#include "
badgetools.h
"
// Include badgetools library
9
10
void
main
()
// Main function
11
{
12
badge_setup
();
// Call badge setup
13
oledprint
(
"RGB LEDs"
);
// Display text
14
oledprint
(
"L R"
);
// Sides
15
while
(1)
// Main loop
16
{
17
rgb
(
L
,
YELLOW
);
// Left, yellow
18
rgb
(
R
,
BLUE
);
// Right, blue
19
pause(400);
// ...for 4/10 s
20
rgb
(
L
,
RED
);
// and so on...
21
rgb
(
R
,
WHITE
);
22
pause(400);
23
rgb
(
L
,
WHITE
);
24
rgb
(
R
,
GREEN
);
25
pause(400);
26
}
27
}
28
29
L
#define L
For selecting the left of the two RGB LEDs. Example: rgb(L, RED) would set the left RGB LED to the co...
Definition:
badgetools.h:88
R
#define R
For selecting the right of the two RGB LEDs. Example: rgb(R, GREEN) would set the right RGB LED to th...
Definition:
badgetools.h:96
YELLOW
#define YELLOW
For setting an RGB LED's color to yellow. Examples: rgb(L, YELLOW) sets the left RGB LED yellow...
Definition:
badgetools.h:144
BLUE
#define BLUE
For setting an RGB LED's color to blue. Examples: rgb(L, BLUE) sets the left RGB LED blue...
Definition:
badgetools.h:104
rgb
void rgb(int side, int color)
Sets the color of the left or right RGB LED. Examples: rgb(L, RED) makes the left RGB LED glow red...
Definition:
leds_rgb.c:9
WHITE
#define WHITE
For setting an RGB LED's color to white. Examples: rgb(L, WHITE) sets the left RGB LED white...
Definition:
badgetools.h:152
oledprint
int oledprint(const char *fmt,...)
Use to display strings on the oLED display in a manner similar to displaying combinations of strings ...
Definition:
peb_text.c:4
main
int main(void)
Definition:
GraphicsTest.c:20
GREEN
#define GREEN
For setting an RGB LED's color to green. Examples: rgb(R, GREEN) sets the right RGB LED to green...
Definition:
badgetools.h:112
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
RED
#define RED
For setting an RGB LED's color to red. Examples: rgb(R, RED) sets the right RGB LED red...
Definition:
badgetools.h:128
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