State Of a Pin
Archiver
Posts: 46,084
How do I represent the state of an I/O pin in my programming? I'm hoping to
make a statement along the lines of:
IF "Pin7 is HIGH" Then "Perform Action"
[noparse][[/noparse]Non-text portions of this message have been removed]
make a statement along the lines of:
IF "Pin7 is HIGH" Then "Perform Action"
[noparse][[/noparse]Non-text portions of this message have been removed]
Comments
>make a statement along the lines of:
>IF "Pin7 is HIGH" Then "Perform Action"
Simple!
IF in7=1 THEN
' perform action
ENDIF
that is the syntax for PBASIC 2.5.
You can also give the pin an alias, such as,
waterHigh pin 7 ' again, "pin" is PBASIC 2.5 syntax
then the statement becomes,
IF waterHigh=1 THEN
' perform action
ENDIF
[noparse][[/noparse]Non-text portions of this message have been removed]