Skip to content

Instantly share code, notes, and snippets.

Created June 30, 2017 13:41
Show Gist options
  • Save anonymous/f2e57639fea4a3d92a33d485d8dfedd7 to your computer and use it in GitHub Desktop.
Save anonymous/f2e57639fea4a3d92a33d485d8dfedd7 to your computer and use it in GitHub Desktop.
TinyCLR OS Testing BrainPad Traffic Light
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