|
|
|
| Our software is compatible, baby. |
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
TIL There's a builtin function for getting the alliance station from FMS
I found a function in the wpilib that tells you what alliance you're on!
![]() Code:
import edu.wpi.first.wpilibj.hal.AllianceStationID; import edu.wpi.first.wpilibj.hal.HAL; AllianceStationID AlianceStation = HAL.getAllianceStation(); boolean redAlliance = false; if(AlianceStation == AllianceStationID.Red1 || AlianceStation == AllianceStationID.Red2 || AlianceStation == AllianceStationID.Red3) redAlliance = true; |
|
#2
|
||||
|
||||
|
Re: TIL There's a builtin function for getting the alliance station from FMS
Quote:
|
|
#3
|
||||
|
||||
|
Re: TIL There's a builtin function for getting the alliance station from FMS
Ok, thanks. I didn't realize that.
|
|
#4
|
||||
|
||||
|
Re: TIL There's a builtin function for getting the alliance station from FMS
Teams have used it before to control their underglow. But auto programming is a good use for it too.
|
|
#5
|
||||
|
||||
|
Re: TIL There's a builtin function for getting the alliance station from FMS
More than a "good use" considering the field isn't rotationally symmetric this year
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|