Example #1
0
File: gpio.py Project: pobot/PyBot
        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
Example #2
0
File: gpio.py Project: pobot/PyBot
 def output(io_num, state):
     GPIO._trace("Output %d set to %s" % (io_num, GPIO._states[state]))
Example #3
0
File: gpio.py Project: pobot/PyBot
 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])
     )
Example #4
0
File: gpio.py Project: pobot/PyBot
 def setmode(addressing_mode):
     GPIO._trace("addressing mode set to %s" % GPIO._modes[addressing_mode])
Example #5
0
File: gpio.py Project: pobot/PyBot
 def setwarnings(enabled):
     GPIO._trace("warnings sets to %s" % enabled)
Example #6
0
File: gpio.py Project: pobot/PyBot
 def cleanup():
     GPIO._trace("GPIOs returned to their default settings")