|
Re: pullup resistor on digital sidecar
The pull-up resistor can't be disabled/enabled in code. It is physically connected at all times.
You can test this by measuring the voltage on the SIG pin on any of the DIO on the sidecar. You'll see it's pulled up.
In terms of how to use it in Java, I always connect any switches between GND and SIG on the DIO. This takes advantage of the pull-up resistor, but the side-effect is that you will have reversed logic in your Java program.
When the switch is closed, the DIO will go to GND, and you'll see a logical 0 (false).
When the switch is open, the DIO will be pulled-up, and you'll see a logical 1 (true).
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
|