Pulling high or low
pcrobot
Posts: 103
Hello,
I'm dealing with a door sensor that has two wires. I'm wireing it like a standard 4-pin pushbutton. One wire goes to P3 and Vss, the other wire goes to Vdd. But when I Debug the state of the sensor it's floating, not accurate. How can I pull it either high or low to get accurate results?
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com
I'm dealing with a door sensor that has two wires. I'm wireing it like a standard 4-pin pushbutton. One wire goes to P3 and Vss, the other wire goes to Vdd. But when I Debug the state of the sensor it's floating, not accurate. How can I pull it either high or low to get accurate results?
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com
Comments
·· Can you draw a simple schematic of what you have?· It sounds like you may be shorting you power supply lines as well...As for a simple push button schematic, if you look in the Editor Help File under the BUTTON command there are examples of both active-low and active-high connections.· I hope this helps.· Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Learn somthing about everything, and Everthing about somthing-
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com
·· Your posted schematic actually answers that question.· In your original post you never mentioned the resistors that are in that schematic.· In any event if you connect like that (active high), you will get a 0 when the button is not pushed, and a 1 when it is.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
What kind of sensor is it? Is it a magnetic reed assembly?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.x3beta.forumup.com