Question about PULSIN
eagletalontim
Posts: 1,399
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!
[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