UBISS2024exam

From Sketching with Hardware at LMU Wiki
Revision as of 10:27, 13 June 2024 by Skwhadmin (talk | contribs) (Created page with "=== Solution Task 1.2 Control external RGB === <syntaxhighlight lang="python" line='line'> # Blinky example import time from machine import Pin # This is the only LED pin av...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Solution Task 1.2 Control external RGB

 1 # Blinky example
 2 
 3 import time
 4 from machine import Pin
 5 
 6 # This is the only LED pin available on the Nano RP2040,
 7 # other than the RGB LED connected to Nano WiFi module.
 8 led = Pin(6, Pin.OUT)
 9 
10 while (True):
11    led.on()
12    time.sleep_ms(250)
13    led.off()
14    time.sleep_ms(200)