Skip to content

Commit

Permalink
Merge pull request #577 from ahpook/led-pulse
Browse files Browse the repository at this point in the history
Badger2040: Make the LED example pulse instead of strobe
  • Loading branch information
helgibbons committed Nov 18, 2022
2 parents 4b3d39b + 2b7a77e commit 62303b6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions micropython/examples/badger2040/led.py
Expand Up @@ -6,7 +6,10 @@
badger = badger2040.Badger2040()

while True:
badger.led(255)
time.sleep(1)
badger.led(0)
time.sleep(1)
# increase badger.led brightness from 0 to 255 and back down to zero
for i in range(0, 255):
badger.led(i)
time.sleep_ms(10)
for i in range(255, 0, -1):
badger.led(i)
time.sleep_ms(10)

0 comments on commit 62303b6

Please sign in to comment.