very strange pin values getting read when nothing is plugged into the pin
qdoggmets
Posts: 14
hi,
i plugged in my keypad, which i talked about in this thread http://forums.parallax.com/showthread.php?p=858329
i have the x and y pins connected for the anode and cathode as well as 2/8 data pins. my program is running a debug function to display the pin values.
i repeat again. i only have 2 leads going to the pin outs on the basic stamp. they are plugged into pin out 0 and pin out 1.
when i run my program·and use the·debug function, i see random pins showing a value of 1 when they should be 0. the pin numbers switch, the amount of pins showing in accurate values switch. its completely random. sometimes its just fine...and others it starts showing wrong values. the wrong values are even being shown in pin outs that don't have any leads going to them.
the code is basic.....it just displays if the pin is up or down so there is nothing funky going on there.
my question is:
how and why is it reading input values into the pin variables when no jumpers are connected to the pin outs?
thanks,
kevin
·
i plugged in my keypad, which i talked about in this thread http://forums.parallax.com/showthread.php?p=858329
i have the x and y pins connected for the anode and cathode as well as 2/8 data pins. my program is running a debug function to display the pin values.
i repeat again. i only have 2 leads going to the pin outs on the basic stamp. they are plugged into pin out 0 and pin out 1.
when i run my program·and use the·debug function, i see random pins showing a value of 1 when they should be 0. the pin numbers switch, the amount of pins showing in accurate values switch. its completely random. sometimes its just fine...and others it starts showing wrong values. the wrong values are even being shown in pin outs that don't have any leads going to them.
the code is basic.....it just displays if the pin is up or down so there is nothing funky going on there.
my question is:
how and why is it reading input values into the pin variables when no jumpers are connected to the pin outs?
thanks,
kevin
·
Comments
-Phil
The simple way to stop this is to tie the input pin to ground through a 10 Kohm resistor. This will cause the pin to report 'zero' when nothing is connected, but is easily overcome by real button-pushes (for instance).