rioboard.ReadDigitalInput(1) is always the one?

6 years 2 months ago #29530287 by mjepson
No matter which Input connection I wire to +5V, only
will return 1. All other values for 'ch' will result in a 0.
When I call
I get a meaningful mask, which I have used to fix it myself, like so:
def read_digital_input(index):
    to_find = 2 ** (index - 1)
    mask = rioboard.ReadAllDigitalInputs()
    return (mask & to_find) > 0

But why doesn't ReadDigitalInput(ch) work as expected?

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds