Reas Activated Pin
erastusk
Posts: 17
Is there a command i can use to read a pin when its activated by a switch accurately.I've tried to use pulsin and i'm not getting an accurate readings.
Thanks
Thanks
Comments
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Parallax Tech Support·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
I was using the if·then code you just posted and wasn't getting really reliable data.However, i was trying to mimick a switch with just a wire, so i think i might need to build an actual switching device to test it.
Thanks guys
a[noparse]:D[/noparse]EBUG IN0
GOTO a
you'll get 1's when you make the connection and 0's when you break it. If not, all is lost, abandon ship!
One you verify that works, check your code for IF/THEN errors.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
DO
DEBUG BIN1 IN0
LOOP
Eratusk, What do you mean by accurately in "read a pin when its activated by a switch accurately"? What do you want to happen when the switch is pressed and then released?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
What i meant by accurately is when i ran the if IN4 loop, i would get 1s and 0s even when the wire was not connected or get the same thing when the wire was connected.
The problem was with the wire itself, it wasn't making contacted with the pin without moving.When i held it tightly it worked.Since I'm using a breadboard this shouldn't be a problem when i solder it.
My Fault, thanks Guys