View Full Version : rc_dig_in help?
our digital imputs are always set to one no matter what we do. We even defined them as zero right before the code that we were testing and they were still set to one and.. thats not suppost to happen. has anyone else had similar problems?
jasonpeinko
18-01-2008, 09:49
what kind of input are you using, i have been trying to get the gear tooth sensor working but i have no printf right now so i cant see whats going on.
Alan Anderson
18-01-2008, 09:56
How are you trying to define an input as zero? What circuitry are you connecting to the input pin?
When you read a digital input, the value you get depends on the voltage on the pin. Ground gives you a zero, and +5 volts gives you a one. The RC input pins have pullup resistors built in, so a pin with no connection is the same as a pin with +5 volts supplied to it.
Mark McLeod
18-01-2008, 11:44
our digital imputs are always set to one no matter what we do. We even defined them as zero right before the code that we were testing and they were still set to one and.. thats not suppost to happen.
You don't set digital inputs in the code, so you can try to assign values to them all you want, but .00002 sec. later it will be overwritten by the hardware and nothing will ever take. As Alan said, the digital input values only reflect the voltage seen at the hardware pins.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.