Table of Contents

Out

Write a digital output value to a pin.

Syntax

from cubloc import Out
 
Out(pin: int, value: int | bool)

Parameters

Example

from time import sleep
from cubloc import Output, Out
 
# LED on GP25, configured as an output
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)