This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| logicpython:cubloc_api:out [2026/04/14 04:05] – [Example] mfranklin | logicpython:cubloc_api:out [2026/04/14 04:14] (current) – [Related APIs] mfranklin | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| from cubloc import Out | from cubloc import Out | ||
| - | Out(pin: int, value: int) | + | Out(pin: int, value: int | bool) |
| </ | </ | ||
| Line 14: | Line 14: | ||
| * **pin**: GPIO '' | * **pin**: GPIO '' | ||
| - | * **value**: '' | + | * **value**: '' |
| ===== Example ===== | ===== Example ===== | ||
| Line 20: | Line 20: | ||
| <code python> | <code python> | ||
| from time import sleep | from time import sleep | ||
| - | from cubloc import Output, | + | from cubloc import Output, |
| # LED on GP25, configured as an output | # LED on GP25, configured as an output | ||
| Line 28: | Line 28: | ||
| while True: | while True: | ||
| # Turn LED on for 500ms | # Turn LED on for 500ms | ||
| - | Out(1) | + | Out(LED, 1) |
| print(" | print(" | ||
| sleep(0.5) | sleep(0.5) | ||
| # Turn LED off for 500ms | # Turn LED off for 500ms | ||
| - | Out(0) | + | Out(LED, 0) |
| print(" | print(" | ||
| sleep(0.5) | sleep(0.5) | ||
| Line 45: | Line 45: | ||
| * [[logicpython: | * [[logicpython: | ||
| * [[logicpython: | * [[logicpython: | ||
| + | * [[logicpython: | ||