Shop OBEX P1 Docs P2 Docs Learn Events
Nid help for GPS and LCD — Parallax Forums

Nid help for GPS and LCD

XanderXander Posts: 23
edited 2008-10-22 14:30 in BASIC Stamp
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

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-10-02 08:16
    xander -

    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.
  • XanderXander Posts: 23
    edited 2008-10-02 12:19
    hmm i have tired to search and read on the serout command things. They changed debug to serout which will show the words u wan to see by editing the words in the program. But there is one thing i find it really hard is that wat i wan is to show the information gathered by the GPS module on the lcd·and not by typing the words to be shown,·i really dunno how to go about changing. Can someone pls show me a sample or guide me through, its really urgent ty
  • curt66140curt66140 Posts: 19
    edited 2008-10-02 14:14
    Here's the GPS Demo code that I modified to display on Parallax's 2x16 serial LCD.· I took some of the routines out that I didn't need for my use but most of it is still in place.· This works on the BS2 but for any of the faster modules you will have to change some of the constants like the baud.

    Hope this helps

    Curt
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-10-02 14:25
    Xander,

    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
  • XanderXander Posts: 23
    edited 2008-10-10 07:49
    Thanks Curt , your code works well.
    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 ?
  • XanderXander Posts: 23
    edited 2008-10-12 02:12
    Could someone help me please ?
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-10-12 17:39
    I don't think that your question is specific enough for us to be able to really help yet.

    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.
    Xander said...
    When tested, the data showed on the LCD was not in order(information in random order).

    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
  • XanderXander Posts: 23
    edited 2008-10-22 07:04
    Anyone can help? Any example?
    ·
  • RDL2004RDL2004 Posts: 2,554
    edited 2008-10-22 14:30
    Xander,

    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
Sign In or Register to comment.