Hello everyone! with the administrator’s permission I am sharing the RD03D.zip library modified with chatgpt and functional for the ESP32 that uses UART2 instead of the Software.h serial not supported by the esp32. And here’s an example of how it works:
#include <RadarSensor.h>
#define RADAR_RX 16
#define RADAR_TX 17RadarSensor radar(RADAR_RX, RADAR_TX, Serial2);
//#include <RadarSensor.h>
//RadarSensor radar(2,3); // RX, TX sensor pinsvoid setup() {
Serial.begin(115200);
radar.begin(256000);
}void loop() {
if(radar.update()) {
RadarTarget tgt = radar.getTarget();
// Send data in CSV form: angle, distance, speed
Serial.print(tgt.angle); Serial.print(“,”);
Serial.print(tgt.distance); Serial.print(“,”);
Serial.println(tgt.speed); // endline to finish each data block
}
delay(100); // optional delay for stable communication
}
And here’s a screenshot of Processing in action
The library
RadarSensor_ESP32_Compat.zip (3.3 KB)
I hope you find it useful, best regards!



