kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Badger2040: Make the LED example pulse instead of strobe
This makes a slightly nicer example as the LED goes gently from off to on and back down again instead of strobing.pull/577/head
rodzic
6ebf1a97f8
commit
2b7a77e110
|
@ -6,7 +6,10 @@ import time
|
|||
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)
|
||||
|
|
Ładowanie…
Reference in New Issue