12345678910111213141516171819202122232425262728293031323334 |
- #include <M5Stack.h>
- HardwareSerial GPSRaw(2);
- void setup() {
-
- M5.begin();
- M5.Power.begin();
- GPSRaw.begin(9600);
- Serial.println("hello");
- termInit();
- M5.Lcd.setTextFont(4);
- M5.Lcd.setCursor(50, 100, 4);
- M5.Lcd.println(("GPS Raw Example"));
- }
- void loop() {
-
- if(Serial.available()) {
- int ch = Serial.read();
- GPSRaw.write(ch);
- }
- if(GPSRaw.available()) {
- int ch = GPSRaw.read();
- Serial.write(ch);
- termPutchar(ch);
- }
- }
|