This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| logicpython:first_program [2026/04/10 02:06] – created - external edit 127.0.0.1 | logicpython: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 | + | # LED on GP25, configured as an output |
| - | Output(LED_PIN) | + | LED = 25 |
| + | Output(LED) | ||
| while True: | while True: | ||
| - | High(LED_PIN) | + | |
| - | | + | |
| - | Low(LED_PIN) | + | |
| - | | + | sleep(0.5) |
| + | |||
| + | # Turn LED off for 500ms | ||
| + | Low(LED) | ||
| + | | ||
| + | sleep(0.5) | ||
| </ | </ | ||
| This toggles the onboard LED every 500 ms. | This toggles the onboard LED every 500 ms. | ||