|
RSeries astromech firmware
|
|
Go to the documentation of this file.
26 fI2CAddress(i2cAddress),
38 return (fLastCmdMillis + 4000 < millis());
48 fToggleMode = toggleMode;
93 sendCommand(kRandomFast);
109 sendCommand(kRandomSlow);
120 sendCommand(kSearchLightCW);
130 sendCommand(kSearchLightCCW);
140 sendCommand(kFaceForward);
149 if (*cmd++ ==
'P' && *cmd++ ==
'S')
151 if (cmd[0] ==
'U' && cmd[1] ==
'P')
155 else if (cmd[0] ==
'D' && cmd[1] ==
'O' && cmd[2] ==
'W' && cmd[3] ==
'N')
159 else if (cmd[0] ==
'F' && cmd[1] ==
'A' && cmd[2] ==
'S' && cmd[3] ==
'T')
163 else if (cmd[0] ==
'S' && cmd[1] ==
'L' && cmd[2] ==
'O' && cmd[3] ==
'W')
167 else if (cmd[0] ==
'S' && cmd[1] ==
'C' && cmd[2] ==
'W')
171 else if (cmd[0] ==
'S' && cmd[1] ==
'C' && cmd[2] ==
'C' && cmd[3] ==
'W')
175 else if (cmd[0] ==
'F' && cmd[1] ==
'W' && cmd[2] ==
'D')
194 void sendCommand(
int cmd)
196 Wire.beginTransmission(fI2CAddress);
198 Wire.endTransmission();
199 fLastCmdMillis = millis();
205 unsigned long fLastCmdMillis;
Encapsulates the available i2c commands that can be sent to the ia-parts.com periscope lifter and per...
Definition: PeriscopeI2C.h:17
void searchLightCCW()
Definition: PeriscopeI2C.h:124
Base class for all command enabled devices. CommandEvent::handleCommand() is called for each device e...
Definition: CommandEvent.h:17
bool isPeriscopeUp()
Definition: PeriscopeI2C.h:41
void randomSlow()
Definition: PeriscopeI2C.h:98
void searchLightCW()
Definition: PeriscopeI2C.h:114
PeriscopeI2C(const byte i2cAddress=0x20)
Constructor.
Definition: PeriscopeI2C.h:25
void randomFast()
Definition: PeriscopeI2C.h:82
void setToggleMode(bool toggleMode)
Definition: PeriscopeI2C.h:46
void faceForward()
Definition: PeriscopeI2C.h:134
bool readyForNewCmd()
Only allow a new command every 4 seconds.
Definition: PeriscopeI2C.h:36
void down()
Down just means down no toggle.
Definition: PeriscopeI2C.h:70
void up()
Definition: PeriscopeI2C.h:51
virtual void handleCommand(const char *cmd) override
Periscope Commands start with 'PS'.
Definition: PeriscopeI2C.h:147