RSeries astromech firmware
PSIMatrix Class Reference

#include <dome/PSIMatrix.h>

Detailed Description

PSIMatrix by Darren Poulson daz@r.nosp@m.2djp.nosp@m..co.u.nosp@m.k

The PSI Matrix devices are based on i2c RGB LED Matrix from Seeed Studios. This class configures them to be used as a PSI using Software I2C to create a new bus.

Example Code:

PSIMatrix rearPSI(22,23,2); // SDA Pin, SCL Pin, PSI.
PSIMatrix frontPSI(24,25,1); // PSI 1 = Front, PSI 2 = Rear
PSIMatrix by Darren Poulson daz@r2djp.co.uk
Definition: PSIMatrix.h:41
+ Inheritance diagram for PSIMatrix:
+ Collaboration diagram for PSIMatrix:

Public Types

enum  EffectValue { kNormalVal = 0 }
 
enum  Sequence { kNormal = 0 , kSolid = 1 , kHeart = 2 , kMalf = 3 }
 
enum  PSIID { kFrontPSI = 1 , kRearPSI = 2 }
 

Public Member Functions

virtual void setup () override
 Subclasses must implement this function to perform any necessary setup that cannot happen in the constructor. More...
 
 PSIMatrix (const byte sdaPin, const byte sclPin, const byte psi)
 Constructor. More...
 
void selectEffect (long inputNum)
 Select the specified effect using a 32-bit integer. More...
 
virtual void handleCommand (const char *cmd) override
 Command Prefix: PS. More...
 
void setSequence (Sequence seq=kNormal, uint8_t speedScale=0, uint8_t numSeconds=0)
 Select the specified effect sequence. More...
 
virtual void animate () override
 Perform a single frame of LED animation based on the selected sequence. More...
 

Member Enumeration Documentation

◆ EffectValue

Enumerator
kNormalVal 

◆ PSIID

Enumerator
kFrontPSI 

Front PSI ID.

kRearPSI 

Rear PSI ID.

◆ Sequence

Enumerator
kNormal 
kSolid 
kHeart 
kMalf 

Constructor & Destructor Documentation

◆ PSIMatrix()

PSIMatrix::PSIMatrix ( const byte  sdaPin,
const byte  sclPin,
const byte  psi 
)
inline

Constructor.

Member Function Documentation

◆ animate()

virtual void PSIMatrix::animate ( )
inlineoverridevirtual

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

Implements AnimatedEvent.

◆ handleCommand()

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

Command Prefix: PS.

Implements CommandEvent.

◆ selectEffect()

void PSIMatrix::selectEffect ( long  inputNum)
inline

Select the specified effect using a 32-bit integer.

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

◆ setSequence()

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

Select the specified effect sequence.

◆ setup()

virtual void PSIMatrix::setup ( )
inlineoverridevirtual

Subclasses must implement this function to perform any necessary setup that cannot happen in the constructor.

Implements SetupEvent.


The documentation for this class was generated from the following file: