I am trying to send a temperature reading from on BOE to another BOE. I can connect the 2 and send on off commands, but I can't (four days now) seem to figure ou thow to send the temp data. Any ideas?
Most data transmission is just a sequence of on/off transmission. What kind of transmitter/receiver are you using and how are you controlling them? Assuming you have a pin that controls transmission and the receiver on the other end puts out a HIGH/LOW signal, you would simply use SERIN and SEROUT at some low speed (2400 Baud is probably low enough) to control the transmitter/ decode the receiver. Once you have serial communication working, you can send decimal numbers with SEROUT and decode them with SERIN using the DEC formatters.
Mike, I am using the Linx RF module transmitter/receiver and the Sensirion SHT11 sensor module. I'm just not getting the debug, so I can view the temperature.
The transmit:
PULSOUT 8, 30000
PAUSE 1
SEROUT 8, 16624, [noparse][[/noparse] "!&"]
The Receive:
DEBUG "Raw Data Temp: "
SERIN 7, 16468, [noparse][[/noparse]WAIT("!&")]
DEBUG DEC soT, ClrRt, CR
tF=soT**11796-400
DEBUG DEC (tF/10),".",DEC1 tF,degsym,clrRt,CR
DEBUG CLS
It would be nice to see the whole program, including the definitions of the variables. I suspect you'll need to send the data as bytes, and not as words. The way you dothat is as follows:
Comments
The transmit:
PULSOUT 8, 30000
PAUSE 1
SEROUT 8, 16624, [noparse][[/noparse] "!&"]
The Receive:
DEBUG "Raw Data Temp: "
SERIN 7, 16468, [noparse][[/noparse]WAIT("!&")]
DEBUG DEC soT, ClrRt, CR
tF=soT**11796-400
DEBUG DEC (tF/10),".",DEC1 tF,degsym,clrRt,CR
DEBUG CLS
Any ideas?
Also, you neither send nor recieve any actual data:
SEROUT 8 , 16624,[noparse][[/noparse]"!&", DEC temp,CR]
SERIN 7, 16468, [noparse][[/noparse]WAIT("!&"), DEC temp]
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
DEBUG "Raw Data Temp: "
SERIN 7, 16468, [noparse][[/noparse]WAIT(temp), DEC temp]
DEBUG DEC (tF/10),".",DEC1 tF,degsym,clrRt,CR
tF=soT**11796-400
DEBUG DEC soT, ClrRt, CR
DEBUG MoveTo, 0, 3
DEBUG "Raw Data Temp: "
DEBUG DEC soT, ClrRt, CR
tF=soT**11796-400
DEBUG DEC (tF/10),".",DEC1 tF,degsym,clrRt,CR
SEROUT 8 , 16624,[noparse][[/noparse]"!&", DEC temp,CR]
PULSOUT 8, 30000
So, where do you do anything with your serin input (if there actually is any)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
-Martin
It would be nice to see the whole program, including the definitions of the variables. I suspect you'll need to send the data as bytes, and not as words. The way you dothat is as follows:
SEROUT OutPin, Baud, [noparse][[/noparse]temp.highbyte, temp.lowbyte]
- - - -
BTW, thie following line of code doesn't make a lot of sense to me. What were you trying to do?
<!--StartFragment -->SERIN 7, 16468, [noparse][[/noparse]WAIT(temp), DEC temp]
You're waiting on a data string which doesn't yet exist????
Regards,
Bruce Bates
Post Edited (Bruce Bates) : 2/22/2007 8:29:55 AM GMT