Source code for SimulRPi.utils

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

try:
    import RPi.GPIO as GPIO
except ImportError:
    import SimulRPi.GPIO as GPIO





[docs]def turn_off_led(channel): """Turn off LEDs from the given channels. Parameters ---------- channel : int or list or tuple Channel numbers associated with LEDs which will be turned off. """ GPIO.output(channel, GPIO.LOW)
[docs]def turn_on_led(channel): """Turn on LEDs from the given channels. Parameters ---------- channel : int or list or tuple Channel numbers associated with LEDs which will be turned on. """ GPIO.output(channel, GPIO.HIGH)