Skip to content

Commit

Permalink
adding a 5-way switch to control the pico
Browse files Browse the repository at this point in the history
  • Loading branch information
jewzaam committed Feb 7, 2021
1 parent a94fb64 commit a1f106f
Show file tree
Hide file tree
Showing 8 changed files with 938 additions and 181 deletions.
Binary file added images/piPico+uln2003+28byj-48+5waySwitch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/fzz/piPico+uln2003+28byj-48+5waySwitch.fzz
Binary file not shown.
25 changes: 12 additions & 13 deletions src/microPython/led_blink.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from machine import Pin
import time
from machine import Pin, Timer
import utime as time
led = Pin(25, Pin.OUT)

# simple script to test that you're communicated to the Pico.. blinks the on-board LED
def blink_fast(timer):
start=time.ticks_ms()
now=start
while time.ticks_diff(now,start) < 5000.0:
led.toggle()
time.sleep_ms(250)
now=time.ticks_ms()
print("DONE: blink_fast")

pin_led = Pin(25, Pin.OUT)

try:
while True:
pin_led.toggle()
time.sleep(1.0)
except KeyboardInterrupt:
pass
finally:
pin_led.off()
Timer().init(mode=Timer.ONE_SHOT, period=0, callback=blink_fast)
Loading

0 comments on commit a1f106f

Please sign in to comment.