Shop OBEX P1 Docs P2 Docs Learn Events
Question about PULSIN — Parallax Forums

Question about PULSIN

eagletalontimeagletalontim Posts: 1,399
edited 2011-11-10 20:19 in General Discussion
I have some code that only needs to run if the PIN it is reading from is not pulled down to ground. I have tried :

[PHP]
pulsinpin PIN RB.4 INPUT SCHMITT

' more stuff here

IF pulsinpin <> 0 THEN
' read the pulsing
ENDIF[/PHP]

but it does not seem to work correctly. The PULSIN function gives random number when it is not connected to the pulsing signal. I need to either return a 0 if the pulsin pin is pulled down or not run the PULSIN if the pin is pulled down.

Any help is appreciated!

Comments

Sign In or Register to comment.