Experimental/Grace-Experimental/src/Subsystems/Lighting.cpp
// TODO: Determine what the commands to the Arduino will look like.
// The following code is based on some sample ideas, and the modes defined above.

Determine what the commands to the Arduino will look like.
The following code is based on some sample ideas, and the modes defined above.
Determine what the commands to the Arduino will look like . The following code is based on some sample ideas and the modes defined above .
void Lighting::sendLightingCommand(bool force) {
	const char * cmd = kLightMapping[alliance_][mode_];
	const bool canSendCommand = cmd && serialPort_;
	const bool shouldSendCommand = (cmd != lastCommand_) || force;
	if (canSendCommand && shouldSendCommand) {
		std::cout << "Sending lighting command: " << cmd;
		serialPort_->Write(cmd);
		lastCommand_ = cmd;
	}
}
void Lighting :: sendLightingCommand ( bool force ) { const char * cmd = kLightMapping [ alliance_ ] [ mode_ ] ; const bool canSendCommand = cmd && serialPort_ ; const bool shouldSendCommand = ( cmd != lastCommand_ ) || force ; if ( canSendCommand && shouldSendCommand ) { std :: cout << " " << cmd ; serialPort_ -> Write ( cmd ) ; lastCommand_ = cmd ; } }
TODO: Determine what the commands to the Arduino will look like.
TODO : Determine what the commands to the Arduino will look like .
// Note that if we have a timeout on the Arduino (handling brownout, reset, etc.),
 // then we may want to force re-sending the command every so often, even if it has
 // not changed.
