def input(io_num): # get the simulated state if defined, otherwise set it to the default value try: state = GPIO.input_states[io_num] except KeyError: GPIO.input_states[io_num] = state = GPIO.LOW GPIO._trace("Reading input %d (simulated state=%s)" % (io_num, state)) return state
def output(io_num, state): GPIO._trace("Output %d set to %s" % (io_num, GPIO._states[state]))
def setup(io_num, direction, pull_up_down=PUD_UP): GPIO._trace( "GPIO %d configured as %s with pull up set to %s" % (io_num, GPIO._directions[direction], GPIO._pullups[pull_up_down]) )
def setmode(addressing_mode): GPIO._trace("addressing mode set to %s" % GPIO._modes[addressing_mode])
def setwarnings(enabled): GPIO._trace("warnings sets to %s" % enabled)
def cleanup(): GPIO._trace("GPIOs returned to their default settings")