I have a little masthead unit sending data over a 433Mhz link to base.
I am reading wind speed, direction & temperature.
I realised I would need to cope with negative temps. Manual 2 suggests -
Do you see any problem in using the read value to set a variable and to use this as a flag at base.
Something like -
Also, do I need the # symbol?
Russ.
I am reading wind speed, direction & temperature.
Code:
#picaxe 08M
main:
high 0
serout 0,T2400,(254,1,254,1)
readadc 1,b1 'get direction
count 3,1000,b2 'wind speed raw data
readtemp 2,b3 'get temperature
pause 100
SerOut 0, T2400, ("UU") 'open TX
Pause 100
SerOut 0, T2400, ("XY ", #b1," ",#b2," ",#b3 ) 'Transmit data
pause 100
low 0 'TX sleep
sleep 5 ' Approx 1/2 minute
goto main
Code:
readtemp 1,b1 ‘ read value into b1
if b1 > 127 then neg ‘ test for negative
serout 7,N2400,(#b1) ‘ transmit value to serial LCD
Something like -
Code:
readtemp 2,b3 'get temperature
b4=0
if b3 > 127 then b4=1
.
.
SerOut 0, T2400, ("XY ", #b1," ",#b2," ",#b3,#b4 ) 'Transmit data
and at the base
serin 1,T2400,("XY"),#b1,#b2,#b3,#b4
if b4=1 then do something else.
Russ.