Unknown input
NosePicker
Posts: 54
I am trying to learn how to monitor an input pin on a Basic Stamp II. I have it on a test breadboard with a 6v power supply.
I have written several test programs like make an led blink and everything seems to work as expected.
However I wrote this simplt program and had nothing hooked to pin 8 and got the following results:
As you can see the input pin appears to report random values as to if it is high or low with nothing hooked to it at all.
Is this normal?
<<<<< Program code >>>>>
<<<<<< Results >>>>>>>
0,0,1,0,1,0,0,1,1,1,0
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thanks
NosePicker
I have written several test programs like make an led blink and everything seems to work as expected.
However I wrote this simplt program and had nothing hooked to pin 8 and got the following results:
As you can see the input pin appears to report random values as to if it is high or low with nothing hooked to it at all.
Is this normal?
<<<<< Program code >>>>>
input 8 checkpin: if IN8 = 0 then ison debug "0," pause 1000 goto checkpin ison: debug "1," pause 1000 goto checkpin
<<<<<< Results >>>>>>>
0,0,1,0,1,0,0,1,1,1,0
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thanks
NosePicker
Comments
If you put a 10,000 ohm resister from IN 8 to ground, this will give you 0,0,0,0,0,0,0,0.· If you hook the resister to +Voltage, you will get 1,1,1,1,1,1,1.
Daryl
This situation Mike explained is called "floating". When you have a circuit hooked up, and you are looking for a high signal, you want the pin to always read a low in a neutral state. That's why you would put a 10K ohm resistor from the pin to ground, like Daryl stated. Then the basic stamp will see a "0" all the time, until a high signal is applied to that pin. Then the resistor link is basically ignored by the basic stamp, and it will read the high signal.
Good luck with the projects.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
David
There are 10 types of people in this world,...
Those that understand binary numbers, and those that don't!!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Thanks
NosePicker