Nid help for GPS and LCD
Xander
Posts: 23
Hello, can anyone pls help me..
how do i edit this part of the program so that it can be shown on the LCD? I've been trying to figure it out for a long time but i still cant do it right.
Get_Lat:
· SEROUT Tx, Baud, [noparse][[/noparse]"!GPS", GetLat]
· SERIN· Tx, Baud, 3000, No_Response, [noparse][[/noparse]degrees, minutes, minutesD.HIGHBYTE, minutesD.LOWBYTE, dir]
· ' convert decimal minutes to tenths of seconds
· workVal = minutesD ** $0F5C· ' minutesD * 0.06
· DEBUG MoveTo, FieldLen, 12, DEC3 degrees, DegSym, " ", DEC2 minutes, MinSym, " "
· DEBUG DEC2 (workVal / 10), ".", DEC1 (workVal // 10), SecSym, " "
· DEBUG "N" + (dir * 5)
· ' convert to decimal format, too
· workVal = (minutes * 1000 / 6) + (minutesD / 60)
· DEBUG " (", " " + (dir * 13), DEC degrees, ".", DEC4 workVal, " )·· "
· RETURN
how do i edit this part of the program so that it can be shown on the LCD? I've been trying to figure it out for a long time but i still cant do it right.
Get_Lat:
· SEROUT Tx, Baud, [noparse][[/noparse]"!GPS", GetLat]
· SERIN· Tx, Baud, 3000, No_Response, [noparse][[/noparse]degrees, minutes, minutesD.HIGHBYTE, minutesD.LOWBYTE, dir]
· ' convert decimal minutes to tenths of seconds
· workVal = minutesD ** $0F5C· ' minutesD * 0.06
· DEBUG MoveTo, FieldLen, 12, DEC3 degrees, DegSym, " ", DEC2 minutes, MinSym, " "
· DEBUG DEC2 (workVal / 10), ".", DEC1 (workVal // 10), SecSym, " "
· DEBUG "N" + (dir * 5)
· ' convert to decimal format, too
· workVal = (minutes * 1000 / 6) + (minutesD / 60)
· DEBUG " (", " " + (dir * 13), DEC degrees, ".", DEC4 workVal, " )·· "
· RETURN
Comments
If you're using a serial LCD, all you really need to do is change the DEBUG commands to SEROUT commands. Take a look at the PBASIC Help File or the PBASIC Reference Manual for details on SEROUT.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When all else fails, try inserting a new battery.
Hope this helps
Curt
In the future please do not create duplicate threads. You already had a thread on this subject. Please follow up in your threads instead of starting new ones.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
Sorry for the mutiple posting
Now i need another help. I need to send the data from the GPS wirelessly to the LCD. The GPS and LCD are mounted on separated Basic Stamps. I had bought a RF Receiver(#27981) and RF Transmitter(#27980) from Parallax. The Transmitter and GPS module are mounted on 1 Basic Stamp, while LCD(4x20 backlift) and RF Receiver on another Basic Stamp. When tested, the data showed on the LCD was not in order(information in random order).
Can someone help me please ?
It is in fact quite possible to do what you're trying to do: I set up two BS2 units last fall with the Parallax 433 transmitter and receiver and the Parallax GPS to send the location data remotely to the unit with the LCD. It does work.
What you need to do is separately learn three things:
1 - How to read the GPS data into your BS2.
2 - How to send data from one BS2 to the other using the 433 MHz units.
3 - How to display data on an LCD screen.
I suggest that you carefully read the documentation for each of the three related accessories (GPS, 433 units, LCD). Look at the sample code provided for each. That's how I figured out how to do it.
What you'll wind up doing is programming the remote BS2 to read the GPS data in (SERIN, with a "WAIT" command looking for the NMEA string you want, probably $GPGGA, then skipping forward through the received data to find the bytes representing position or whatever data you're after). Once those data are in variables in that remote unit, you'll send 'em out through the transmitter, perhaps preceded by some code that you specify that the receiving unit will "WAIT" for in order to know when valid GPS data are coming>
Here's a site that shows the data given in the NMEA sentences:
home.mira.net/~gnb/gps/nmea.html#gpgga
On the receiving end, you'll SERIN those data (again, possibly using "WAIT" to look for a special code), read them into variables on that BS2. Then you'll SEROUT those variables to the LCD (assuming you're using a serial LCD, right? If not, you might want to make sure you're using a BS2p-series so that you can use LCDOUT).
That's the gist of it - you should be able to figure out the code specifics.
You have to read the bytes that make up the data into separate variables and put those variables in order yourself when you display them.
Post Edited (sylvie369) : 10/12/2008 5:53:15 PM GMT
·
If you had everything working the way you wanted using one Stamp but not from one to another then your problem is in the communication.
Go back and get the two Stamps communicating in the simplest way possible. Use the demo code from the receiver/transmitter as a starting point if any is available.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick