Im having trouble with a simple project. Im wanting to send data between 2 pics using the serin/serout commands in picbasic pro. Basically Im wanting the transmitting pic to send data out serially when a button is pressed, the reciever will turn on a led(for testing purposes, in application it will store the data sent) while the button is pressed.
Are there any obvious errors Im missing?
Are there any obvious errors Im missing?
Code:
B0 VAR byte
input porta.2
output porta.3
'Transmitter
main:
B0 = 0
button porta.2, 0, 255, 255, B0, 1, transmit
goto main
transmit:
serout porta.3, 4, ["A", 125]
goto main
end
'Receiver
B0 VAR byte
output porta.2
input porta.3
main:
B0 = 0
serin porta.3, 4,["A"], B0
if B0 = 125 then
high porta.2
else
low porta.2
endif
goto main
end