I got the SEROUT line from your posting(yesterday, 19:49), but all I really want to do is send an id (25 or 35) and a 4 digit temp or humidity reading, then receive same using the serout2/serin2 commands. When I send the command to the remote module it receives it perfectly as it is a constant number and sends what it is asked to....
receive: ' receive
portc.1 = 1 ' switch on port
pause 25 ' give radio 25 ms to slew
SERIN2 PORTC.0,16780,250,main,[command]
if command = 25 then goto tempsend
if command = 35 then goto humsend
goto main
When I send 25 it goes to tempsend, when I send 35 it goes to humsend.
My latest attempt to send what I want is as follows:
tempsend:
portc.1=0 ' Back to main
lcdout $fe,1,"tx t" ' send to lcd
portc.3=1 ' switch on tx
for c =0 to 4 ' start 4 pass loop
pause 150
SEROUT2 PORTc.2,16780,[temp]
PAUSE 100 ' Pause 100uS
next c ' next pass
portc.3=0 ' switch off tx
goto main ' Back to main
temp is a 4 digit number and comes from the SHT71 sensor and is displayed correctly on the LCD
The above is received with:
SERIN2 PORTc.4,16780,250,programstart,[str myvar\4]
HSEROUT ["A= ",dec myvar," B= ",#myvar," C= ",myvar," ",32,13,10] ' Display result
CLEAR ' Clear array
so I can have an idea what is being received and work out how to make it what I want




Bookmarks