Source code for utils

"""Collection of utility functions used for the SimulRPi library.
"""
import time

# Import RPi.GPIO if found. Otherwise, fallback to SimulRPi.GPIO
try:
    import RPi.GPIO as GPIO
except ImportError:
    import SimulRPi.GPIO as GPIO





[docs]def turn_off_led(channel): """Turn off a LED from a given channel. Parameters ---------- channel : int Channel number associated with a LED which will be turned off. """ GPIO.output(channel, GPIO.LOW)
[docs]def turn_on_led(channel): """Turn on a LED from a given channel. Parameters ---------- channel : int Channel number associated with a LED which will be turned on. """ GPIO.output(channel, GPIO.HIGH)