|
RSeries astromech firmware
|
|
Go to the documentation of this file.
27 fID(ledControl.addDevice()),
30 fPause(1000+2000*random(3)),
32 fDelay(50 + random(3) * 25),
50 fLC.clearDisplay(fID);
51 fLC.setIntensity(fID, 15);
52 fLC.setPower(fID,
true);
58 fLC.setPower(fID, on);
82 for (
byte col = 0; col < 6; col++)
84 byte mask = (col < state) ? B10101010 : B01010101;
85 fLC.setColumn(fID, col, ((col & 1) == 0) ? mask : ~mask);
98 for (
byte col = 0; col < 6; col++)
99 fLC.setColumn(fID, col, mask);
151 unsigned long currentMillis = millis();
152 if (fLC.isPowered(fID) && fAnimate && fDelay > 0 &&
153 currentMillis - fMillis >= fPauseTime)
158 if (fState != 0 && fState != 6)
166 fPauseTime = random(fPause);
168 if (random(100) <= fStuck)
170 fState = (fState == 0) ? random(1, 3) : random(3, 5);
174 fMillis = currentMillis;
179 static int getNextID()
188 unsigned long fMillis;
189 unsigned int fPauseTime;
@ kJawaOther
Definition: JawaEvent.h:17
JawaID
Definition: JawaEvent.h:6
void setPower(bool on)
Definition: TeecesPSI.h:56
Base class for all animated devices. AnimatedEvent::animate() is called for each device once through ...
Definition: AnimatedEvent.h:18
Base class for all devices that require setup that cannot happen in the constructor....
Definition: SetupEvent.h:15
@ kJawaRearPSI
Definition: JawaEvent.h:13
@ kJawaFrontPSI
Definition: JawaEvent.h:12
void setStuckChance(byte chance)
Definition: TeecesPSI.h:71
void setSolidState(byte mask)
Definition: TeecesPSI.h:95
void setAnimate(bool animate)
Definition: TeecesPSI.h:90
virtual void jawaCommand(char cmd, int arg, int value) override
Subclasses should override this method to handle commands specifying a value.
Definition: TeecesPSI.h:102
void setPause(unsigned int pause)
Definition: TeecesPSI.h:61
Base class for all devices implementing JAWA lite support.
Definition: JawaEvent.h:31
void setJawaAddress(int addr)
Specify the JAWA address of this device.
Definition: JawaEvent.h:84
void setDelay(byte delay)
Definition: TeecesPSI.h:66
virtual void animate()
Subclasses must implement this function to run through a single frame of animation/activity.
Definition: TeecesPSI.h:149
Process State Indicator.
Definition: TeecesPSI.h:22
void setState(byte state)
Definition: TeecesPSI.h:76
#define UNUSED_ARG(arg)
Definition: ReelTwo.h:25
TeecesPSI(LedControl &ledControl)
Definition: TeecesPSI.h:25
virtual void setup() override
Subclasses must implement this function to perform any necessary setup that cannot happen in the cons...
Definition: TeecesPSI.h:48