Files
2018-12-26 19:01:16 +08:00

28 lines
494 B
Arduino

#include <M5Stack.h>
/* By default, GPS is connected with M5Core through UART2 */
HardwareSerial GPSRaw(2);
void setup() {
M5.begin();
GPSRaw.begin(9600);// GPS init
Serial.println("hello");
termInit();
}
void loop() {
// put your main code here, to run repeatedly:
if(Serial.available()) {
int ch = Serial.read();
GPSRaw.write(ch);
}
if(GPSRaw.available()) {
int ch = GPSRaw.read();// read GPS information
Serial.write(ch);
termPutchar(ch);
}
}