|
libpropeller
Making PropellerGCC Easier
|
Elum class to allow access to single Elums. More...
#include <elum.h>
Public Types | |
| enum | elumColor { RED, GREEN } |
| Use these constants to set the displayed LED color: Max8819::RED Max8819::GREEN. More... | |
| enum | patternType { kSingleSlow, kSingle, kSingleSyncopated, kDouble, kTriple, kManyFast, kJitterFast } |
Public Member Functions | |
| Elum (int RedPin, int GreenPin, int ButtonPin) | |
| Initialize the Elum class. More... | |
| Elum () | |
| void | Start (int RedPin, int GreenPin, int ButtonPin) |
| ~Elum () | |
| bool | GetButton () |
| void | Slowclock (void) |
| void | On (elumColor whichColor) |
| void | Off (void) |
| void | Flash (int color, int period_ms, int flash_ms) |
| Set the LED color to flash. More... | |
| void | Pattern (patternType pattern) |
| Alternate in the following pattern: More... | |
| void | Fade (int frequency) |
| Fades both LEDs in and out. More... | |
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.
| enum Elum::elumColor |
| enum Elum::patternType |
|
inline |
Initialize the Elum class.
| RedPin | the pin that the RED led is sunk to |
| GreenPin | the pin that the GREEN led is sunk to |
| ButtonPin,: | the pin to make input to read the button. The button should have a pullup, so that it is NC=1, and active low. |

|
inline |
|
inline |

|
inline |
Fades both LEDs in and out.
| frequency | The rate at which to flash the combined LEDs, in units of 0.1Hz/LSb |

|
inline |
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 |
|
inline |
|
inline |
|
inline |
|
inline |
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

|
inline |
|
inline |
1.8.4