Dependancies
Pre-requisites
Buy the components
gps-tbeam.ino
#include <HardwareSerial.h>
#define GPS_SERIAL_NUM 1
#define GPS_RX_PIN 34
#define GPS_TX_PIN 12
HardwareSerial GPSSerial(GPS_SERIAL_NUM);
void setup() {
Serial.begin(115200);
GPSSerial.begin(9600, SERIAL_8N1, GPS_RX_PIN, GPS_TX_PIN);
Serial.println("Hello GPS");
}
void loop() {
if (Serial.available()) {
char c = Serial.read();
GPSSerial.write(c);
}
if (GPSSerial.available()) {
char c = GPSSerial.read();
Serial.write(c);
}
}
BOARD?=esp32:esp32:t-beam
PORT?=/dev/cu.SLAB_USBtoUART
.PHONY: default lint all flash clean
default: all flash clean
lint:
cpplint --extensions=ino --filter=-legal/copyright *.ino
all:
arduino-cli compile --fqbn $(BOARD) ./
flash:
arduino-cli upload -p $(PORT) --fqbn $(BOARD)
clean:
rm -r build
This example contains displaying GPS from uBlox Neo-6M module on the serial monitor on a ESP-32 based LilyGO T-Beam T22_V1.1, 20191212
. Pins IO12
is used as TX
and pin IO34
is used as RX
as shown in the schematic for V1.1.
make
command.