Created
December 26, 2022 22:07
-
-
Save LindseyB/a245dfed657a2ca7aa98040f43b4783a to your computer and use it in GitHub Desktop.
Revisions
-
Lindsey Bieda created this gist
Dec 26, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ # Imports from machine import Pin import time #Set up our LED names and GPIO pin numbers red = Pin(18, Pin.OUT) amber = Pin(19, Pin.OUT) green = Pin(20, Pin.OUT) counter = 1 # Set the counter to 1 while counter < 11: # While count is less than 11 print(counter) # Print the current counter # Red ON red.value(1) # ON amber.value(0) # OFF green.value(0) # OFF time.sleep(0.5) # Wait half a second # Amber ON red.value(0) # OFF amber.value(1) # ON green.value(0) # OFF time.sleep(0.5) # Wait half a second # Green ON red.value(0) # OFF amber.value(0) # OFF green.value(1) # ON time.sleep(0.5) # Wait half a second counter += 1 # Add 1 to our counter