Andyf, Use this syntax to accomplish your task:
SWB:
PIN = in_ctl[1] ' 0 - 7
STATE = in_ctl[2] ' H or L
if STATE = "H" then PortB.0[PIN]=1
if STATE = "L" then PortB.0[PIN]=0
Goto mainloop
actually if you send a "0" or a "1" decimal for the state you can save another line of code by using the syntax:
SWB:
PIN = in_ctl[1] ' 0 - 7
STATE = in_ctl[2] ' H or L
PortB.0[PIN] = state - 48
Goto mainloop
Infact if you don't need to save the "state" for later reference you don't even need it at all by using the syntax:
SWB:
PIN = in_ctl[1] ' 0 - 7
PortB.0[PIN] = in_ctl[2] - 48
Goto mainloop
Dave Purola,
N8NTA
Bookmarks