Quasics2021Code/Mae/src/main/cpp/commands/FieldLightingCommand.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 FieldLightingCommand::Execute() {
  const auto colorData = frc::DriverStation::GetInstance().GetAlliance();
  switch(colorData){
    case frc::DriverStation::kRed:
    lights->SetLightsColor(255, 0, 0);
    break;
    case frc::DriverStation::kBlue:
    lights->SetLightsColor(0, 0, 255);
    break;
    case frc::DriverStation::kInvalid:
    default:
    lights->SetLightsColor(0, 255, 0);
    break;
  }
}
void FieldLightingCommand :: Execute ( ) { const auto colorData = frc :: DriverStation :: GetInstance ( ) . GetAlliance ( ) ; switch ( colorData ) { case frc :: DriverStation :: kRed : lights -> SetLightsColor ( 255 , 0 , 0 ) ; break ; case frc :: DriverStation :: kBlue : lights -> SetLightsColor ( 0 , 0 , 255 ) ; break ; case frc :: DriverStation :: kInvalid : default : lights -> SetLightsColor ( 0 , 255 , 0 ) ; break ; } }
Called repeatedly when this Command is scheduled to run
Called repeatedly when this Command is scheduled to run