This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| logicpython:cubloc_api:output [2026/04/10 02:06] – created - external edit 127.0.0.1 | logicpython:cubloc_api:output [2026/04/14 04:15] (current) – [Related APIs] mfranklin | ||
|---|---|---|---|
| Line 18: | Line 18: | ||
| <code python> | <code python> | ||
| - | from cubloc import Output | + | from time import sleep |
| + | from cubloc import Output, High, Low | ||
| - | # Example usage | + | # LED on GP25, configured as an output |
| - | Output(0) | + | LED = 25 |
| + | Output(LED) | ||
| + | |||
| + | while True: | ||
| + | # Turn LED on for 500ms | ||
| + | High(LED) | ||
| + | print(" | ||
| + | sleep(0.5) | ||
| + | |||
| + | # Turn LED off for 500ms | ||
| + | Low(LED) | ||
| + | print(" | ||
| + | sleep(0.5) | ||
| </ | </ | ||
| Line 31: | Line 44: | ||
| * [[logicpython: | * [[logicpython: | ||
| * [[logicpython: | * [[logicpython: | ||
| + | * [[logicpython: | ||