Main Menu

DigitalRead Issue

Started by Marquis, August 31, 2020, 11:55:51 PM

Marquis


I must be doing something wrong but I'm getting strange results using digitalRead. The pin is normally tied low, when the switch is closed 1.6 volts is sent to it (from a voltage divider circuit).

When I poll the pin, I get LOW all the time -even when the button is pressed. When I double check the voltage with my multimeter, it suddenly works. I get a HIGH when the button is pressed. When I remove my meter, the pin stops reading HIGH. If do an analogread, I get 504 when the button is pressed. With or without the meter attached. The result is the same.

My question - what is the meter doing that is changing the reading? And how can it be doing anything, the analogRead is always the same. Any suggestions?

Felix

Digital read will need more than 1.6v to read HIGH at VCC=3.3V.