Trouble reading PINK variable
Hello,
I am working on a PINK project. I have an SX28 sending outside temperature and inside temperature to the PINK. The outside temperature is obtained from a 433MHz RF receiver and the inside temperature is via a LTC1298 and a LM34 mounted alongside the SX. I successfully accomplished· this and can view the temperatures on a web page loaded in the PINK.· The web page will also let me change the contents of PINK Variable Number 10 to a 1 or 0 via a Radio button (verified via PINK).
Here is what I am having trouble doing. I want to check the contents of Variable #10. If it is a one (1) then I want to make RC.1 go high, thus triggering an SSR. I am monitoring the RC.1 pin with an LED and nothing happens, it appears that the SERIN statement is timing out or my code is not detecting the ASCII one("1").
BTW, I have done this with the BS2.
Working code is attached, it does contain un-used subroutines. Any help/suggestion you may offer will be much appreciated.
MikeS
I am working on a PINK project. I have an SX28 sending outside temperature and inside temperature to the PINK. The outside temperature is obtained from a 433MHz RF receiver and the inside temperature is via a LTC1298 and a LM34 mounted alongside the SX. I successfully accomplished· this and can view the temperatures on a web page loaded in the PINK.· The web page will also let me change the contents of PINK Variable Number 10 to a 1 or 0 via a Radio button (verified via PINK).
Here is what I am having trouble doing. I want to check the contents of Variable #10. If it is a one (1) then I want to make RC.1 go high, thus triggering an SSR. I am monitoring the RC.1 pin with an LED and nothing happens, it appears that the SERIN statement is timing out or my code is not detecting the ASCII one("1").
BTW, I have done this with the BS2.
Working code is attached, it does contain un-used subroutines. Any help/suggestion you may offer will be much appreciated.
MikeS
SXB
![](/plugins/FileUpload/images/file.png)
13K
Comments
I believe you have one too many commas in the SERIN command. Here is what I saw in your code:
Just remove the comma after the SERIN command.
Gary
Thanks for looking at the code but that is not the problem, that was just a typo that I made before I posted the code here. It won't even compile with that comma there.
MikeS
Can you post the working BS2 code too ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
What command is READINC? I have not seen any mention of it in the SX/B help file, Gunther's book, nor the SK-Key Manual?
Thanks,
Gary
It is in the latest help file that you can download from here http://forums.parallax.com/showthread.php?p=597707
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.iElectronicDesigns.com
·
I am not very familiar with the P.I.N.K. (I know what it is but have never used it.) However, in looking at your program I see that after you send data to the P.I.N.K. you spend a fair amount of time blinking LED2. Unlike the SHIFTIN command which only clocks in data when it is ready, SERIN has to be "watching" for the data when it is being sent. Otherwise it will miss some or all of what is transmitted. I suspect that while you are blinking LED2 the data from the P.I.N.K. is being sent. If so, your program will not be expecting it at that time and will not receive it. Try moving your SERIN statement and related logic to right after you send the data (or whenever you can expect the P.I.N.K. to send data back.)
You might also need to play with the baudmode setting unless you are certain what it should be. It might help if you can connect the P.I.N.K. to the serial port of your computer temporarily and use a terminal program to verify that what you think is being sent is actually being sent.
Sens-a-Dat,
READINC is similar to READ but increments the index automatically. This is explained with READ in the latest version of the help file. If it is not explained in your version you may want to download the latest update. You can find the latest version in a "sticky post" at the top of this forum.
- Sparks
I am very impressed with Parallax (both personnel and products) and the support provided by others here in the forums.
Gary
Still have not figured out this PINK problem.
Bean, You asked for a copy of the BS2 code that worked with the PINK, it is attached.
Sparks, I removed all the blinking led stuff still no help. I know the Baud is correct because it works for the writing of the Temps to the Pink variables.
I did place a·PAUSEUS 10 statement between the SEROUT read request and the SERIN request and ·I did get valid data back one time - just once. It has to be a timming issue with the SX.
Mikes
Try removing the colon from the command you're sending...That shouldn't be there for a read operation.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
You da Man! The colon was it. I really appreciate you and the others who took time to look for the problem.
Now if I could only get the SX to communicate with the Digiencabulator via the PINK!
Thanks again,
MikeS