You are on page 1of 1

InitLEDs

Init TEAM LEDs


Initialize PB2 - PB3 to be digital outputs
Turn off LEDs at initialization by writing LO to BIT2 and BIT3

Init Game Indicator LED


Initialize PF4 to be digital outputs
Turn off LEDs at initialization by writing LO to BIT4

Init Team setting


Initialize PF3 to be digital input
End of InitLEDs

TurnOffLEDs
Turn off LEDs by writing LO to PB2, PB3 & PF4
End of TurnOffLEDs

TurnOnRLED
Turn on Red LED by writing HI to PB2
End of TurnOnRLED

TurnOnBLED
Turn on Blue LED by writing HI to PB3
End of TurnOnBLED

TurnOnYLED
Turn on game indicator LED by writing HI to PF4
End of TurnOnYLED

GetTeamColor
read PF3
if PF3 is HI, return RED (1), otherwise return BLUE (0)
End of GetTeamColor

You might also like