20#define RADAR_RX_PIN 16
21#define RADAR_TX_PIN 17
24#define RADAR_BAUDRATE 256000
56 unsigned long now = millis();
59 Serial.print(
" ms] Presence detected: ");
60 Serial.println(presenceDetected ?
"YES" :
"NO");
80 Serial.println(
"LD2410Async Example: Basic Presence Detection");
87 Serial.println(
"Radar task started successfully.");
92 Serial.println(
"ERROR! Could not start radar task.");
bool lastPresenceDetected
HardwareSerial RadarSerial(1)
void setup()
Arduino setup function which initializes the radar and registers the callback.
void onDetectionDataReceived(LD2410Async *sender, bool presenceDetected)
Callback function called whenever new detection data arrives.
LD2410Async radar(RadarSerial)
Creates LD2410Async object bound to the serial port defined in RadarSerial.
#define RADAR_RX_PIN
Example: Basic Presence Detection with LD2410Async.
void loop()
Arduino loop function which does nothing.
Asynchronous driver class for the LD2410 human presence radar sensor.
bool begin()
Starts the background task that continuously reads data from the sensor.
void onDetectionDataReceived(DetectionDataCallback callback)
Registers a callback for new detection data.