Pages: [1]   Go Down
Author Topic: Problem between SoftwareSerial.h and serLCD.h  (Read 474 times)
0 Members and 1 Guest are viewing this topic.
Switzerland
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
Code:
#include <serLCD.h>
#include <SoftwareSerial.h>
#include <Arduino.h>

#define COMMA 0x2C  // zum GPS-Daten in String trennen

SoftwareSerial GPS (2,0); // Pin 2  Eingang vom GPS TX-1
serLCD lcd(3);                // Pin 3  Ausgang zu Serlcd RX

char gps_string[55]; //  Zeichen vom GPS-Empfänger
char d_string[40];    //   Data String 33 Zeichen
char p_string[55];    //   Position String 49 Zeichen
char z =0;              // Zähler für die Anzahl empfangenen Zeichen 
char c=0;               // Speicher für NewSoftSerial Zeichen hinterlegt
char _state = 0;      // Zähler für erhaltene GPS-String

char *s;                 // Adresse vom Lat/Lon_String zum Umwandeln in float
char *pChar;          // Adresse für die Bildung vom Lat/Lon_String
unsigned char j, k;  // Zähler für die Bildung vom Lat/Lon_String

float _decimal(char* s);// convert degree-decimal value of latitude terms
char lat_string[10];
char lon_string[10];
float _lat,_lat1;
float _lon, _lon1;
float _degs;
boolean feedgps();


void setup() 
{
  Serial.begin(57600);
   
  GPS.begin(4800);  //Set data rate from GPS Receiver
  delay(100);
 
  //This initialize the display to blank with the backlight on
  lcd.clear();
  delay(100);
  lcd.print(" Globalposition ");
  lcd.setCursor(2, 1);
  lcd.print(" Willy Klemenz");
  delay(5000);
  lcd.clear();
   
}

void loop()   // run over and over again
 {
   boolean newdata= false;
   if (feedgps())
     newdata = true;
       
   if (newdata) 
     {
          Serial.println("receive data");
          Serial.println(d_string);
          Serial.println(p_string);
          daten();
          Serial.println(lat_string);   
          Serial.println(lon_string);   
          lcd.clear();
          lcd.setCursor(1,1);
          lcd.print(lat_string);
     }
 }


If I want display also data from GPS on the LCD screen then Serial Monitor show me:
   
    receive data
    GPGLL,4730.3712,N,00924.9408,E,170110.00,A,A*62
    ,A,A*62
    2

If I turn off the display commands in loop
           //lcd.clear();
          //lcd.setCursor(1,1);
          //lcd.print(lat_string);

the  Serial-Monitor shows me correct data:

  receive data
  GPZDA,165245.00,21,01,2013,,*65
  GPGLL,4730.3732,N,00924.9421,E,165240.00,A,A*69
  4730.3732
  00924.9421

Maybe someone knows where can be the problem?
Willy
Logged

Austin, TX
Online Online
Faraday Member
**
Karma: 71
Posts: 6137
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Shouldn't there be a lcd.begin() somewhere?
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You commented out three lines. Which ONE actually causes the problem?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Already with the first  lcd.clear();
How long does it take to clear the LCD? Perhaps you are missing serial data from the GPS while that is happening.

How are you displaying data on the Serial Monitor, when the hardware serial pins are being used to talk to the LCD?
Logged

Pages: [1]   Go Up
Jump to: