Hello…
A followup on this thread.
A quick update for Serial communication example for XIAO ESP32S3 via Grove Expansion Base with pins D7,D6 for Rx,Tx respectively.
Regards…
// GPS pass data Serial test (from serial port tester)
// Receives from the main USB serial port, sends to the (Serial 1) port.
// Receives from serial port 1(GPS AIR530), sends to the USB main serial (Serial 0).
// This example works on Xiao Nref52840 Sense (serial1)port pins 7,8
// The circuit:
// - GPS AIR530 serial device attached to Serial port 1
// - USB Serial Monitor open on Serial port (this one is port 21)
// - Once you get data then try the U center app (older version )
// - add free Google API key to prefrences to get the whole experiernce. total time 30 minutes
// Serial communication example for XIAO ESP32S3 via Grove Expansion Base
// This example reads incoming data from Serial1 (via Grove port)
// and prints it to the Serial monitor (via USB).
#define RX_PIN D7 // Grove RX pin (connected to Grove device TX)
#define TX_PIN D6 // Grove TX pin (connected to Grove device RX)
void setup()
{
// Initialize USB serial for debugging
Serial.begin(115200);
while (!Serial); // Wait for the Serial port to connect
// Initialize hardware serial (Serial1) on the Grove pins D6 and D7
// The baud rate must match your Grove device's baud rate.
Serial1.begin(9600, SERIAL_8N1, RX_PIN, TX_PIN);
Serial.println("XIAO ESP32S3 Serial Example Started");
Serial.println("Monitoring Serial1 (Grove) for incoming data...");
}
void loop()
{
// Check if data is available from the Grove device on Serial1
if (Serial1.available())
{
// Read the incoming byte
char inByte = Serial1.read();
Serial.write(inByte);
}
// read from port 0, send to port 1:
if (Serial.available())
{
int inByte = Serial.read();
Serial1.write(inByte);
}
}