Difference between revisions of "UBISS2024exam"

From Sketching with Hardware at LMU Wiki
Jump to navigation Jump to search
Line 4: Line 4:
 
# This is the only LED pin available on the Nano RP2040,
 
# This is the only LED pin available on the Nano RP2040,
 
# other than the RGB LED connected to Nano WiFi module.
 
# other than the RGB LED connected to Nano WiFi module.
led = Pin(6, Pin.OUT)
+
x = Pin(6, Pin.OUT)
  
 
while (True):
 
while (True):
   led.on()
+
   x.on()
   time.sleep_ms(250)
+
   time.sleep_ms(500)
   led.off()
+
   x.off()
   time.sleep_ms(200)
+
   time.sleep_ms(100)
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 10:28, 13 June 2024

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