• Witaj na Forum Arduino Polska! Zapraszamy do rejestracji!
  • Znajdziesz tutaj wiele informacji na temat hardware / software.
Witaj! Logowanie Rejestracja


Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
dane z serial port
#1
Witam wiem że to pewnie banalne ale chciałem zapytać jak wydobyć konkretną informację z komunikatu NMEA(GPS).
czyli z tego :

  $GPVTG,,T,,M,0.859,N,1.591,K,A*2B
  $GPGGA,123201.20,5107.94277,N,01706.05690,E,1,07,1.31,165.4,M,40.4,M,,*59
  $GPGSA,A,3,16,30,05,09,02,23,07,,,,,,3.41,1.31,3.15*0C
  $GPGSV,3,1,11,02,31,263,26,04,39,083,21,05,28,306,20,06,21,217,10*76
  $GPGSV,3,2,11,07,71,167,16,09,56,083,17,16,18,040,23,23,28,088,19*71
  $GPGSV,3,3,11,26,02,021,,29,03,327,08,30,40,205,17*4C
  $GPGLL,5107.94277,N,01706.05690,E,123201.20,A,A*6E
  $GPRMC,123201.40,A,5107.94266,N,01706.05687,E,0.660,,301119,,,A*7C


chciałbym wydobyć w linijce GPVTG, prędkość, czyli 1.591 i przesłać do innej zmiennej.

w tej chwili prosty kod do odczytu:

#include <SoftwareSerial.h>
SoftwareSerial gpsBoard (2, 3, false);

void setup() {
  Serial.begin(115200);
  gpsBoard.begin(9600);
}

void loop() {
  while (gpsBoard.available()) {

    byte c = gpsBoard.read();                  // Read the GPS data
    Serial.print((char)c);
  }
}


i teraz jak ze zmiennej c wydobyć to co mnie interesuje.

Pozdrawiam Serdecznie
 
Odpowiedź
  


Wiadomości w tym wątku
dane z serial port - przez tabulek - 30-11-2019, 14:35
RE: dane z serial port - przez error105 - 30-11-2019, 15:20
RE: dane z serial port - przez Robson Kerman - 30-11-2019, 18:24
RE: dane z serial port - przez elvis - 30-11-2019, 18:26
RE: dane z serial port - przez Robson Kerman - 30-11-2019, 21:39
RE: dane z serial port - przez elvis - 30-11-2019, 21:59
dane z serial port - przez Robson Kerman - 30-11-2019, 22:53
RE: dane z serial port - przez tabulek - 30-11-2019, 23:12
RE: dane z serial port - przez tabulek - 01-12-2019, 00:09
RE: dane z serial port - przez Robson Kerman - 01-12-2019, 16:20
RE: dane z serial port - przez tabulek - 02-12-2019, 12:05
RE: dane z serial port - przez Robson Kerman - 02-12-2019, 15:07
RE: dane z serial port - przez tabulek - 02-12-2019, 18:24
RE: dane z serial port - przez tabulek - 02-12-2019, 18:30
RE: dane z serial port - przez Robson Kerman - 04-12-2019, 09:35
RE: dane z serial port - przez tabulek - 04-12-2019, 16:27
RE: dane z serial port - przez Robson Kerman - 04-12-2019, 20:27
RE: dane z serial port - przez Jarewa0606 - 04-12-2019, 17:08
RE: dane z serial port - przez tabulek - 05-12-2019, 12:40
RE: dane z serial port - przez Robson Kerman - 05-12-2019, 14:14
RE: dane z serial port - przez tabulek - 25-12-2019, 23:54
RE: dane z serial port - przez Jarewa0606 - 26-12-2019, 11:45

Skocz do:


Przeglądający: 1 gości