User Tools

Site Tools

한국어

logicpython:cubloc_api:out

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
logicpython:cubloc_api:out [2026/04/14 04:05] – [Example] mfranklinlogicpython: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)
 </code> </code>
  
Line 14: Line 14:
  
   * **pin**: GPIO ''pin'' number.   * **pin**: GPIO ''pin'' number.
-  * **value**: ''Output'' level where 0 is low and non-zero is high.+  * **value**: ''Output'' level where 0 or Boolean ''False'' is lowand non-zero or Boolean ''True'' is high.
  
 ===== Example ===== ===== Example =====
Line 20: Line 20:
 <code python> <code python>
 from time import sleep from time import sleep
-from cubloc import Output, High, Low+from cubloc import Output, Out
  
 # 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("LED ON")     print("LED ON")
     sleep(0.5)     sleep(0.5)
  
     # Turn LED off for 500ms     # Turn LED off for 500ms
-    Out(0)+    Out(LED, 0)
     print("LED OFF")     print("LED OFF")
     sleep(0.5)     sleep(0.5)
Line 45: Line 45:
   * [[logicpython:cubloc_api:low|Low]]   * [[logicpython:cubloc_api:low|Low]]
   * [[logicpython:cubloc_api:output|Output]]   * [[logicpython:cubloc_api:output|Output]]
 +  * [[logicpython:cubloc_api:reverse|Reverse]]
  
logicpython/cubloc_api/out.1776139536.txt.gz · Last modified: by mfranklin