This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| logicpython:first_program [2026/04/10 06:31] – mfranklin | logicpython:first_program [2026/04/14 05:16] (current) – mfranklin | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| <code python> | <code python> | ||
| - | import | + | from time import sleep |
| - | from cubloc import | + | from cubloc import |
| - | led_pin | + | # LED on GP25, configured as an output |
| - | Output(led_pin) | + | LED = 25 |
| + | Output(LED) | ||
| while True: | while True: | ||
| - | High(led_pin) | + | |
| + | | ||
| print(" | print(" | ||
| - | | + | sleep(0.5) |
| - | Low(led_pin) | + | |
| + | | ||
| print(" | print(" | ||
| - | | + | sleep(0.5) |
| </ | </ | ||
| This toggles the onboard LED every 500 ms. | This toggles the onboard LED every 500 ms. | ||