User Tools

Site Tools

한국어

logicpython:first_program

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
logicpython:first_program [2026/04/10 02:06] – created - external edit 127.0.0.1logicpython:first_program [2026/04/14 05:16] (current) mfranklin
Line 4: Line 4:
  
 <code python> <code python>
-from cubloc import Output, High, Low, Delay+from time import sleep 
 +from cubloc import Output, High, Low
  
-LED_PIN = 25 +# LED on GP25, configured as an output 
-Output(LED_PIN)+LED = 25 
 +Output(LED)
  
 while True: while True:
-    High(LED_PIN+    # Turn LED on for 500ms 
-    Delay(500+    High(LED
-    Low(LED_PIN+    print("LED ON") 
-    Delay(500)+    sleep(0.5) 
 + 
 +    # Turn LED off for 500ms 
 +    Low(LED
 +    print("LED OFF") 
 +    sleep(0.5) 
 </code> </code>
  
 This toggles the onboard LED every 500 ms. This toggles the onboard LED every 500 ms.
  
logicpython/first_program.1775786798.txt.gz · Last modified: by 127.0.0.1