Quasics2018Code/Hedy-2019/src/main/cpp/Commands/LightingDefault.cpp
// Called repeatedly when this Command is scheduled to run

Called repeatedly when this Command is scheduled to run
Called repeatedly when this Command is scheduled to run
void LightingDefault::Execute() {
	 char status = Robot::lighting->GetMode();
	 char color = Robot::lighting->GetColor();
	 if(status == 'a'){
		 teleOpCounter = -1;
		 autoCounter = autoCounter + 1;
	 }
	 else if(status == 't'){
		 autoCounter = -1;
		 teleOpCounter = teleOpCounter + 1;
	 }
	 else{
		 autoCounter = 0;
		 teleOpCounter = 0;
	 }
	 if(teleOpCounter % 150 == 0){
		 Robot::lighting->WriteTeleOp();
	 }
	 else if(autoCounter % 100 == 0){
		 Robot::lighting->WriteAuto();
	 }
	 else{
	 }
	 if(autoCounter == 0){
		 if(color == 'r'){
			 Robot::lighting->WriteRed();
		 }
		 else if(color == 'b'){
			 Robot::lighting->WriteBlue();
		 }
		 else{
			 Robot::lighting->WriteGreen();
		 }
	 }
}
void LightingDefault :: Execute ( ) { char status = Robot :: lighting -> GetMode ( ) ; char color = Robot :: lighting -> GetColor ( ) ; if ( status == ' ' ) { teleOpCounter = -1 ; autoCounter = autoCounter + 1 ; } else if ( status == ' ' ) { autoCounter = -1 ; teleOpCounter = teleOpCounter + 1 ; } else { autoCounter = 0 ; teleOpCounter = 0 ; } if ( teleOpCounter % 150 == 0 ) { Robot :: lighting -> WriteTeleOp ( ) ; } else if ( autoCounter % 100 == 0 ) { Robot :: lighting -> WriteAuto ( ) ; } else { } if ( autoCounter == 0 ) { if ( color == ' ' ) { Robot :: lighting -> WriteRed ( ) ; } else if ( color == ' ' ) { Robot :: lighting -> WriteBlue ( ) ; } else { Robot :: lighting -> WriteGreen ( ) ; } } }
Called repeatedly when this Command is scheduled to run
Called repeatedly when this Command is scheduled to run