PropWare
C++ objects and CMake build system for Parallax Propeller
|
#include <elum.h>
Public Types | |
enum | elumColor { RED, GREEN } |
enum | patternType { kSingleSlow, kSingle, kSingleSyncopated, kDouble, kTriple, kManyFast, kJitterFast } |
Public Member Functions | |
Elum (int RedPin, int GreenPin, int ButtonPin) | |
void | Start (int RedPin, int GreenPin, int ButtonPin) |
bool | GetButton () |
void | Slowclock (void) |
void | On (elumColor whichColor) |
void | Off (void) |
void | Flash (int color, int period_ms, int flash_ms) |
void | Pattern (patternType pattern) |
void | Fade (int frequency) |
Elum class to allow access to single Elums
(SRLM): What are the hardware requirements?
Some parts based on Pins.h by David Michael Betz. Some parts based on an example by Tracey Allen.
libpropeller::Elum::Elum | ( | int | RedPin, |
int | GreenPin, | ||
int | ButtonPin | ||
) |
void libpropeller::Elum::Fade | ( | int | frequency | ) |
void libpropeller::Elum::Flash | ( | int | color, |
int | period_ms, | ||
int | flash_ms | ||
) |
Set the LED color to flash.
For example:
elum.Flash(Elum::GREEN, 1000, 750); //Set Green to turn on for 750ms, and off for 250ms
color | Elum::RED or Elum::GREEN |
period_ms | The frequency that the color is flashed |
flash_ms | The duration of the displayed color. Must be less than period_ms |
bool libpropeller::Elum::GetButton | ( | ) |
void libpropeller::Elum::Pattern | ( | patternType | pattern | ) |
Alternate in the following pattern:
Single Slow: 5, 10, 0 (RG RG RG RG ...) ~13 seconds / cycle Single Slow Reverse: 5, 10, 50 (GR GR GR GR ...) ~13 seconds / cycle Single: 20, 60, 0 (G R G R G R ...) Single Syncopated: 20, 60, 50 (RG GR RG GR ...) Double: 20, 100, 0 (R R G G R R ...) Triple: 10, 50, 50 (G G GR R RG ...) Many Fast: 20, 400, 0 (G ... R ... ) Fast flickers, repeat each color ~ 10 times ~3 seconds / cycle Jitter Fast: 200, 300, 0 (GGRR GGRR ...) Really fast
Definition at line 144 of file elum.h.