Created
June 30, 2017 13:41
-
-
Save anonymous/f2e57639fea4a3d92a33d485d8dfedd7 to your computer and use it in GitHub Desktop.
TinyCLR OS Testing BrainPad Traffic Light
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void TestTraffic() | |
{ | |
while (true) | |
{ | |
BrainPad.TrafficLight.TurnRedOff(); | |
BrainPad.TrafficLight.TurnGreenOn(); | |
BrainPad.Display.DrawTextAndShowOnScreen(0, 0, "Go"); | |
BrainPad.Wait.Seconds(3); | |
BrainPad.TrafficLight.TurnGreenOff(); | |
BrainPad.TrafficLight.TurnYellowOn(); | |
BrainPad.Display.DrawTextAndShowOnScreen(0, 0, "Slow"); | |
BrainPad.Wait.Seconds(1); | |
BrainPad.TrafficLight.TurnYellowOff(); | |
BrainPad.TrafficLight.TurnRedOn(); | |
BrainPad.Display.DrawTextAndShowOnScreen(0, 0, "STOP"); | |
BrainPad.Wait.Seconds(3); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment