-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding a 5-way switch to control the pico
- Loading branch information
Showing
8 changed files
with
938 additions
and
181 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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
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) |
Oops, something went wrong.