Indexing port pins for serout2/serin2
in reference to this thread:
http://www.picbasic.co.uk/forum/showthread.php?t=13529
This makes sense and works for turning pins on and off and works when I use it, but when I try to do something like:
serout2 porta.0[25], 8276, ["hello"]
25 should be portd.1 on pic16f877
I get serial data out on port B2. It seems to always come out on B2 no matter what I stick in for x in porta.0[x]
serout2 portd.1,8276,["hello"] works.
I want to do serial in and out on around 16 pins but I want to use some code like this to save code space:
Relay var Byte[4]
x var byte
i var byte
Relay[1] = 14 'RB6
Relay[2] = 20 'RC4
Relay[3] = 26 'RD2
main:
' cycle through relays
for i = 1 to 3
x = relay[i]
serout2 porta.0[x], 8276, ["hello"]
PAUSE 300
next i
Thanks!