RSeries astromech firmware
DataPanel Class Reference

#include <body/DataPanel.h>

Detailed Description

DataPanel controller.

DataPanel consists of a single MAX7221 device.
----------------------------------
Yellow Block (top row of LEDs) ROW #4
Column# 5 4 3
Bit 3 4 5
-----
O O O
Solid top row pattern B00011100
Yellow Block (bottom row of LEDs)
Column# 0 1 2
Bit 8 7 6
-----
O O O
Solid top row pattern B11100000
----------------------------------
Green Block (top row of LEDs) ROW #5
Column# 5 4 3
Bit 3 4 5
-----
O O O
Solid top row pattern B00011100
Green Block (bottom row of LEDs)
Column# 0 1 2
Bit 8 7 6
-----
O O O
Solid top row pattern B11100000
----------------------------------
Right side Red Yellow Green Bargraph ROW #2 and ROW #3
Vertical grid starting from top:
B11111100 fills left side of LEDs (ROW #2)
B11111100 fills right side of LEDs (ROW #3)
----------------------------------
Blue Bargraph ROW #0
Vertical row starting from top:
B11111100 fills LEDs (ROW #0)
----------------------------------
Bottom LEDs ROW #1
Horizontal grid starting from left:
B11100000 fills top row (ROW #1)
B00011100 fills bottom row (ROW #1)
+ Inheritance diagram for DataPanel:
+ Collaboration diagram for DataPanel:

Public Types

enum  EffectValue { kNormalVal = 0 }
 
enum  Sequence { kNormal = 0, kDisabled = 1, kFlicker = 2 }
 

Public Member Functions

 DataPanel (LedControl &ledControl)
 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 'DP'. More...
 
void setYellowBlock (byte top, byte bottom)
 Set the yellow block LEDs. More...
 
void setGreenBlock (byte top, byte bottom)
 Set the green block LEDs. More...
 
void setRed1Led (bool on)
 Set the Red #1 LED. More...
 
void setRed2Led (bool on)
 Set the Red #2 LED. More...
 
void setBottomLed (byte top, byte bottom)
 Set the bottom LEDs. More...
 
void setBlueLed (byte pattern)
 Set the blue LEDs. More...
 
void setBargraph (byte value)
 Set the bargraph height. More...
 
byte getBargraph ()
 Get the current bargraph height. 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...
 

Member Enumeration Documentation

◆ EffectValue

Enumerator
kNormalVal 

◆ Sequence

Enumerator
kNormal 
kDisabled 
kFlicker 

Constructor & Destructor Documentation

◆ DataPanel()

DataPanel::DataPanel ( LedControl &  ledControl)
inline

Constructor.

Member Function Documentation

◆ animate()

virtual void DataPanel::animate ( )
inlineoverridevirtual

Perform a single frame of LED animation based on the selected sequence.

Implements AnimatedEvent.

◆ getBargraph()

byte DataPanel::getBargraph ( )
inline

Get the current bargraph height.

◆ handleCommand()

virtual void DataPanel::handleCommand ( const char *  cmd)
inlineoverridevirtual

ChargeBayIndicator Commands start with 'DP'.

Implements CommandEvent.

◆ selectEffect()

void DataPanel::selectEffect ( long  inputNum)
inline

Select the specified effect using a 32-bit integer.

  • Sequence (0-99) * 10000
  • Speed (0-9) * 100
  • Duration (0-99)

◆ setBargraph()

void DataPanel::setBargraph ( byte  value)
inline

Set the bargraph height.

0 off 1 green 2 green, green 3 green, green, yellow 4 green, green, yellow, yellow 5 green, green, yellow, yellow, red 6 green, green, yellow, yellow, red, red

◆ setBlueLed()

void DataPanel::setBlueLed ( byte  pattern)
inline

Set the blue LEDs.

◆ setBottomLed()

void DataPanel::setBottomLed ( byte  top,
byte  bottom 
)
inline

Set the bottom LEDs.

◆ setGreenBlock()

void DataPanel::setGreenBlock ( byte  top,
byte  bottom 
)
inline

Set the green block LEDs.

◆ setRed1Led()

void DataPanel::setRed1Led ( bool  on)
inline

Set the Red #1 LED.

◆ setRed2Led()

void DataPanel::setRed2Led ( bool  on)
inline

Set the Red #2 LED.

◆ setSequence()

void DataPanel::setSequence ( Sequence  seq = kNormal,
uint8_t  speedScale = 0,
uint8_t  numSeconds = 0 
)
inline

Select the specified effect sequence.

◆ setup()

virtual void DataPanel::setup ( )
inlineoverridevirtual

Perform any initialzation not possible in the constructor.

Implements SetupEvent.

◆ setYellowBlock()

void DataPanel::setYellowBlock ( byte  top,
byte  bottom 
)
inline

Set the yellow block LEDs.


The documentation for this class was generated from the following file:
DataPanel
DataPanel controller.
Definition: DataPanel.h:81