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

Next revision
Previous revision
logicpython:cubloc_api:out [2026/04/10 02:06] – created - external edit 127.0.0.1logicpython: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 =====
  
 <code python> <code python>
-from cubloc import Out+from time import sleep 
 +from cubloc import Output, Out
  
-Example usage +LED on GP25, configured as an output 
-Out(0, 1)+LED = 25 
 +Output(LED) 
 + 
 +while True: 
 +    # Turn LED on for 500ms 
 +    Out(LED, 1
 +    print("LED ON") 
 +    sleep(0.5) 
 + 
 +    # Turn LED off for 500ms 
 +    Out(LED, 0) 
 +    print("LED OFF"
 +    sleep(0.5)
 </code> </code>
  
Line 32: 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.1775786798.txt.gz · Last modified: by 127.0.0.1