RSeries astromech firmware
|
#include <body/ChargeBayIndicator.h>
ChargeBayIndicator (CBI) controller.
ChargeBayIndicator (CBI) consists of a single MAX7221 device operating a 5x4 grid of LEDs plus 3 individual VCC indicator LEDs.
Public Types | |
enum | EffectValue { kNormalVal = 0 } |
enum | Sequence { kNormal = 0, kDisabled = 1, kFlicker = 2, kNaboo = 3, kCharging = 4, kBlink = 5, kHeart = 6, kVCCOnly = 7 } |
Public Member Functions | |
ChargeBayIndicator (LedControl &ledControl, int analogInput=-1) | |
Constructor. More... | |
void | selectEffect (long inputNum) |
Select the specified effect using a 32-bit integer. More... | |
void | setSequence (Sequence seq=kNormal, uint8_t speedScale=0, uint8_t numSeconds=0) |
Select the specified effect sequence. More... | |
virtual void | setup () override |
Perform any initialzation not possible in the constructor. More... | |
virtual void | animate () override |
Perform a single frame of LED animation based on the selected sequence. More... | |
virtual void | handleCommand (const char *cmd) override |
ChargeBayIndicator Commands start with 'CB'. More... | |
void | setRow (byte row, byte data) |
This function is only for the grid pattern not the VCC LEDs. More... | |
void | setGreenLight (bool on) |
Turn the green LED on or off. More... | |
void | setYellowLight (bool on) |
Turn the yellow LED on or off. More... | |
void | setRedLight (bool on) |
Turn the red LED on or off. More... | |
void | displayVCC () |
Set the green/yellow/red LEDs based on the voltage levels read from the voltage divider. More... | |
void | randomSEQ () |
Update LEDs randomly for one frame. More... | |
void | blinkSEQ () |
Test utility routine for blinking all LEDs every two seconds. More... | |
void | heartSEQ () |
Pulse. More... | |
void | chargingSEQ () |
Animate the LEDs like ESB charging sequence. More... | |
void | operatingSEQ () |
Operating sequence. More... | |
void | setVCCAnalogInputPin (int analogInput) |
Specify the analog pint used by the voltage divider. More... | |
float | getVCC () |
Read the voltage level from the voltage divider. More... | |
Public Member Functions inherited from AnimatedEvent | |
AnimatedEvent () | |
Default Constructor. More... | |
void | setLoopDoneCallback (AnimatedLoopDone loopProc) |
Additional Inherited Members | |
Static Public Member Functions inherited from AnimatedEvent | |
static void | process () |
Calls animate() for each created AnimatedEvent subclass. More... | |
|
inline |
Constructor.
"analogInput" defaults to disabled
|
inlineoverridevirtual |
Perform a single frame of LED animation based on the selected sequence.
Implements AnimatedEvent.
|
inline |
Test utility routine for blinking all LEDs every two seconds.
|
inline |
Animate the LEDs like ESB charging sequence.
|
inline |
Set the green/yellow/red LEDs based on the voltage levels read from the voltage divider.
|
inline |
Read the voltage level from the voltage divider.
|
inlineoverridevirtual |
ChargeBayIndicator Commands start with 'CB'.
Implements CommandEvent.
|
inline |
Pulse.
|
inline |
Operating sequence.
|
inline |
Update LEDs randomly for one frame.
|
inline |
Select the specified effect using a 32-bit integer.
|
inline |
Turn the green LED on or off.
|
inline |
Turn the red LED on or off.
|
inline |
This function is only for the grid pattern not the VCC LEDs.
Only the top 5 bits of each byte are significant. Shift up 3 to allow our B-style source code constants to reflect what we see displayed.
|
inline |
Select the specified effect sequence.
|
inlineoverridevirtual |
Perform any initialzation not possible in the constructor.
Implements SetupEvent.
|
inline |
Specify the analog pint used by the voltage divider.
|
inline |
Turn the yellow LED on or off.