Created
September 26, 2017 19:43
-
-
Save bazwilliams/79d4cd19a908dc94fdd183a2e5e474a3 to your computer and use it in GitHub Desktop.
BBC Micro:bit Traffic LIghts
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
while (true) { | |
pins.digitalWritePin(DigitalPin.P8, 1) | |
pins.digitalWritePin(DigitalPin.P12, 0) | |
pins.digitalWritePin(DigitalPin.P16, 0) | |
basic.pause(5000) | |
pins.digitalWritePin(DigitalPin.P8, 1) | |
pins.digitalWritePin(DigitalPin.P12, 1) | |
pins.digitalWritePin(DigitalPin.P16, 0) | |
basic.pause(1000) | |
pins.digitalWritePin(DigitalPin.P8, 0) | |
pins.digitalWritePin(DigitalPin.P12, 0) | |
pins.digitalWritePin(DigitalPin.P16, 1) | |
basic.pause(5000) | |
pins.digitalWritePin(DigitalPin.P8, 0) | |
pins.digitalWritePin(DigitalPin.P12, 1) | |
pins.digitalWritePin(DigitalPin.P16, 0) | |
basic.pause(1000) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment