You've already forked M5-ProductExampleCodes
mirror of
https://github.com/m5stack/M5-ProductExampleCodes.git
synced 2026-05-20 10:24:10 -07:00
28 lines
494 B
Arduino
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);
|
|
}
|
|
}
|