Reading the toggle switch

Reading the toggle switch#

#!/usr/bin/env python3
import time
import synergy_logic
from slm_rp4_helpers import read_switch_state

base = synergy_logic.Base()
output = base[1][1]

while True:
    output.value = read_switch_state()
    time.sleep(0.05)

See Onboard Peripherals for the full switch and LED API.