Skip to content

Instantly share code, notes, and snippets.

@kisst
Created August 24, 2021 10:21
Show Gist options
  • Save kisst/6156a6df95f6f3b9cc4139f65fd9c141 to your computer and use it in GitHub Desktop.
Save kisst/6156a6df95f6f3b9cc4139f65fd9c141 to your computer and use it in GitHub Desktop.
rpi pico circuitpython demo
import board
import digitalio
import time
led = digitalio.DigitalInOut(board.GP25)
led.direction = digitalio.Direction.OUTPUT
def blink(count=1, delay=0.5):
for cv in range(count):
led.value = True
time.sleep(delay)
led.value = False
time.sleep(delay)
diff = 1
cv = 1
while True:
blink(2, 1/cv)
cv = cv + diff
if (cv == 1 and diff == -1) or ( cv == 60 and diff == 1):
diff = diff * -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment