GPSRaw.ino 645 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. Description: The command data of the USB UART is forwarded to the GPS Unit for debugging and functional verification.
  3. */
  4. #include <M5Stack.h>
  5. HardwareSerial GPSRaw(2);
  6. void setup() {
  7. M5.begin();
  8. M5.Power.begin();
  9. GPSRaw.begin(9600);
  10. Serial.println("hello");
  11. termInit();
  12. M5.Lcd.setTextFont(4);
  13. M5.Lcd.setCursor(50, 100, 4);
  14. M5.Lcd.println(("GPS Raw Example"));
  15. }
  16. void loop() {
  17. // put your main code here, to run repeatedly:
  18. if(Serial.available()) {
  19. int ch = Serial.read();
  20. GPSRaw.write(ch);
  21. }
  22. if(GPSRaw.available()) {
  23. int ch = GPSRaw.read();
  24. Serial.write(ch);
  25. termPutchar(ch);
  26. }
  27. }