Floating input
Jsav
Posts: 25
Howdy all,
··· My problem is that I'm using a pushbutton as a condition with which to initiate a bunch of actions, and I'm having trouble controlling what the basic stamp sees.
The circuit I'm using (x3) is given by page 90 of the What's a Microcontroller - Student Guide, or http://www.parallax.com/Portals/0/Downloads/docs/books/edu/Wamv2_2.pdf
When the pushbutton is depressed, IN3 reads 1 as long is it's depressed and the LED will blink on and off as suggested, however, when the pushbutton is not depressed IN3 has a tendancy to float between 1 and 0, and I'm not sure why. I can't program for actions that are based on the condition of IN3 (0 or 1) if it keeps floating between, obviously I want it to be 0 when left alone and be 1 when and only when the pushbutton is depressed.
Any suggestions on why IN3 is floating? or what I can do to remedy this.
It also happens on any input pin, not just 3.
··· My problem is that I'm using a pushbutton as a condition with which to initiate a bunch of actions, and I'm having trouble controlling what the basic stamp sees.
The circuit I'm using (x3) is given by page 90 of the What's a Microcontroller - Student Guide, or http://www.parallax.com/Portals/0/Downloads/docs/books/edu/Wamv2_2.pdf
When the pushbutton is depressed, IN3 reads 1 as long is it's depressed and the LED will blink on and off as suggested, however, when the pushbutton is not depressed IN3 has a tendancy to float between 1 and 0, and I'm not sure why. I can't program for actions that are based on the condition of IN3 (0 or 1) if it keeps floating between, obviously I want it to be 0 when left alone and be 1 when and only when the pushbutton is depressed.
Any suggestions on why IN3 is floating? or what I can do to remedy this.
It also happens on any input pin, not just 3.
Comments
Are you using a 10K pull-down resistor as suggested on page 90?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
' {$STAMP BS2p}
' {$PBASIC 2.5}
DO
DEBUG ? IN5
PAUSE 800
DEBUG ? IN7
PAUSE 800
IF (IN5 = 1) THEN
HIGH 13
PAUSE 50
LOW 13
PAUSE 50
ELSE
PAUSE 100
ENDIF
IF (IN7 = 1) THEN
HIGH 15
PAUSE 50
LOW 15
PAUSE 50
ELSE
PAUSE 100
ENDIF
LOOP
in this case, both LED's blink accordingly when the pushbutton is depressed, connected to pins 13 and 15 respectively, but again, the debug displays that pin5 and pin7 are floating between 1 and 0 when the pushbutton is left alone.
I am using 100KOhm pullup and see always·1.
Please explain what do you mean by "floating " between 0 and 1.
Do you mean alternating between 0 an 1 ?·