#include <SoftwareSerial.h> // Software Serial library
SoftwareSerial GPS_Serial(5,6); // 5:RXD, 6:TXD
void GPS_Read(char *SoftSerialBuffer){
int i = 0; // Move first character position
char read_ch;
while (1) {
if (GPS_Serial.available()) { // Check empty buffer
read_ch = GPS_Serial.read(); // Read one character from buffer
SoftSerialBuffer[i] = read_ch; // Copy reading character to return-variable
if (read_ch == 10) break;
i++;
}
}
SoftSerialBuffer[i] = '\0'; // Set end-of-string as '\0'
}
void setup() { //***** set serial port speed (bps)
Serial.begin(115200); // USB
GPS_Serial.begin(9600); // Software Serial setting for GPS module
}
void loop() {
char GPS_Data_Raw[255]; // Buffer size is 254 characters.
Serial.println("Loop"); // Eye catcher
if (GPS_Serial.available()) { // Check empty buffer
GPS_Read(GPS_Data_Raw); // Call GPS_Read function routine
Serial.println(GPS_Data_Raw);
}
}
#include <SoftwareSerial.h> // Software Serial library
SoftwareSerial GPS_Serial(5,6); // 5:RXD, 6:TXD
void setup() {
//***** set serial port speed (bps)
Serial.begin(115200); // USB
GPS_Serial.begin(9600); // Software Serial setting for GPS module
}
void loop() {
if (GPS_Serial.available()) {
Serial.write(GPS_Serial.read());
}
}
This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.