XIAO ESP-32c6 + mr60bha2 mmWave sensor arduino examples not working

Based on the tutorial, you have to upload the following code in Arduino IDE:
#include <Arduino.h>
#include “Seeed_Arduino_mmWave.h”

// If the board is an ESP32, include the HardwareSerial library and create a
// HardwareSerial object for the mmWave serial communication
#ifdef ESP32

#include <HardwareSerial.h>

HardwareSerial mmWaveSerial(0);
#else
// Otherwise, define mmWaveSerial as Serial1

#define mmWaveSerial Serial1

#endif

void setup() {
// Initialize the serial communication for debugging
Serial.begin(115200);
while (!Serial) {
; // Wait for Serial to initialize
}

// Initialize the mmWaveSerial communication
mmWaveSerial.begin(115200);
}

void loop() {
// Check if there is data available from mmWaveSerial
while (mmWaveSerial.available() > 0) {
char receivedChar = mmWaveSerial.read();
Serial.write(receivedChar); // Forward data to Serial
}

// Check if there is data available from Serial
while (Serial.available() > 0) {
char receivedChar = Serial.read();
mmWaveSerial.write(receivedChar); // Forward data to mmWaveSerial
}
}
Please take a screenshot of the Arduino IDE serial monitor after you upload this code. If the result shows that:

That indicates the radar is working. Again, we cannot help you any more if you don’t share any details with us.

Regards,
John

1 Like