Merge pull request #577 from ahpook/led-pulse
Badger2040: Make the LED example pulse instead of strobe
This commit is contained in:
commit
62303b6912
|
@ -6,7 +6,10 @@ import time
|
||||||
badger = badger2040.Badger2040()
|
badger = badger2040.Badger2040()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
badger.led(255)
|
# increase badger.led brightness from 0 to 255 and back down to zero
|
||||||
time.sleep(1)
|
for i in range(0, 255):
|
||||||
badger.led(0)
|
badger.led(i)
|
||||||
time.sleep(1)
|
time.sleep_ms(10)
|
||||||
|
for i in range(255, 0, -1):
|
||||||
|
badger.led(i)
|
||||||
|
time.sleep_ms(10)
|
||||||
|
|
Loading…
Reference in New Issue