Trouble referencing variables from other objects to send data.
Michelle S.
Posts: 5
To anyone who may be able to help ,
I'm trying to send my temp/humidity data that i collected using my modified SensirionDemo1 object and Sensirion subroutine object, thru my 433MHz RF Transceiver. Using the Transceiver TX Demo object and RF_Transceiver subroutine object to send my data. The Transceiver RX Demo object and RF_Transceiver subroutine object to receive my data. I want my data to look the same in the Parallax Serial Terminal on the receiving end, as it looked when i used my modified SensirionDemo1 object. The problem I'm having is that when i added some strings to the Transceiver TX Demo object shown below. It keeps giving me an error " expected expression term" and highlighting the word "rawtemp". I think "rawtemp" is a variable. Can one top object access another top object's variables?
The original Transceiver TX Demo object, The original RF_Transceiver subroutine object, my two most resent modified Transceiver TX Demo object and the Transceiver RX Demo object are attached below. Also, my original modified SensirionDemo1 object, the Sensirion subroutine object and my two most resent modified SensirionDemo1 objects are attached below. If you can respond as soon as possible. I would be very grateful!!!
Thank You Very Much for your time and help.
MichelleS
I'm trying to send my temp/humidity data that i collected using my modified SensirionDemo1 object and Sensirion subroutine object, thru my 433MHz RF Transceiver. Using the Transceiver TX Demo object and RF_Transceiver subroutine object to send my data. The Transceiver RX Demo object and RF_Transceiver subroutine object to receive my data. I want my data to look the same in the Parallax Serial Terminal on the receiving end, as it looked when i used my modified SensirionDemo1 object. The problem I'm having is that when i added some strings to the Transceiver TX Demo object shown below. It keeps giving me an error " expected expression term" and highlighting the word "rawtemp". I think "rawtemp" is a variable. Can one top object access another top object's variables?
The original Transceiver TX Demo object, The original RF_Transceiver subroutine object, my two most resent modified Transceiver TX Demo object and the Transceiver RX Demo object are attached below. Also, my original modified SensirionDemo1 object, the Sensirion subroutine object and my two most resent modified SensirionDemo1 objects are attached below. If you can respond as soon as possible. I would be very grateful!!!
Thank You Very Much for your time and help.
MichelleS
{{ TransceiverTXDemo1.8.spin}} CON _CLKMODE = XTAL1 + PLL16X _XINFREQ = 5_000_000 PacketLength = 32 'Total Number of data BYTES 'Changed packetlength from 11 to 32. OBJ RF : "RF_Transceiver" fp : "FloatString" f : "Float32" sht : "Sensirion" sen : "SensirionDemo1.6" {PUB sen. rawTemp rawTemp := f.FFloat(sht.readTemperature) 'Tried to make "rawTemp" accessible to PUB TX_Main. } PUB TX_Main RF.Initialize(PacketLength) sen.Start repeat RF.PutTXString(String("Hello World")) ''<-- Loads Transmit buffer RF.PutTXString(String(" Temp:")) RF.PutTXString(sen.main(rawTemp := f.FFloat(sht.readTemperature)) RF.PutTXString(fp.FloatToFormat(rawTemp, 5, 0)) RF.PutTXString(String(" RH:")) RF.Send ''<-- Sends Transmit buffer
Comments
You're better off using cut and paste to take routines from any demo program and paste them into your own program, then modify them as needed to work with your overall needs.