• 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
#13
(02-12-2019, 15:07)Robson Kerman napisał(a): Co się dzieje w tej pętli?
Kod:
while (gpsBoard.available()) {
ReadString = gpsBoard.readString();

Serial.print(ReadString);

}

Nic nie wypisuje na serial?
Bo jeśli nic nie wypisuje, to znaczy że GPS nic nie wysyła, a to już nie wina kodu tylko sprzętu (połączenia, zasilanie itp.).

ten kod co podałem na początku wypisuje komunikaty nmea.
po zmianie na String, czyli:

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

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

void loop()
{   
  while (gpsBoard.available() > 0 ) {
    ReadString = gpsBoard.readString();
   
    Serial.println(ReadString);

  }
  // ReadString.trim();                        // usuwamy spacje przed $

  // if (ReadString.startsWith("$GPVTG")) {    // jeśli string zaczyna się znakami $GPVTG

    //  for (int x = 0 ; x < 7; x++){        // usuń wszystko do siódmego przecinka
      //    int pozycja=ReadString.indexOf(',');
        //  ReadString.remove(0, pozycja+1);

    //  }
        //  char Speed[3];         
        //    for (int i=0; i < 3; i++){
        //    Speed[i]=ReadString.charAt(i);  // przeczytaj pięć pierwszych znaków       
        //    }
          //  Serial.print(Speed);
  //}
 
}

nic nie ma...
nie rozumiem ?
 
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