23#define RADAR_RX_PIN 16
24#define RADAR_TX_PIN 17
27#define RADAR_BAUDRATE 256000
49 Serial.println(
"Config updated successfully!");
52 Serial.println(
"Failed to apply config.");
71 Serial.println(
"Failed to request config data.");
75 Serial.println(
"Config data received. Cloning and modifying...");
93 Serial.println(
"Error! Could not update config on the sensor");
114 Serial.begin(115200);
118 Serial.println(
"LD2410Async example: change radar config");
125 Serial.println(
"Radar task started successfully.");
131 Serial.println(
"Error! Could not start config data request");
136 Serial.println(
"Error! Could not start radar task");
HardwareSerial RadarSerial(1)
void onConfigReceived(LD2410Async *sender, LD2410Async::AsyncCommandResult result)
Callback after receiving the config data.
void setup()
Arduino setup function which initializes the radar and starts the config change process.
void onConfigApplied(LD2410Async *sender, LD2410Async::AsyncCommandResult result)
Callback after the new config has been written to the sensor.
LD2410Async radar(RadarSerial)
Creates LD2410Async object bound to the serial port defined in RadarSerial.
#define RADAR_RX_PIN
Example: Change configuration of the LD2410.
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.
AsyncCommandResult
Result of an asynchronous command execution.
@ SUCCESS
Command completed successfully and ACK was received.
bool configureAllConfigSettingsAsync(const LD2410Types::ConfigData &configToWrite, bool writeAllConfigData, AsyncCommandCallback callback)
Applies a full ConfigData struct to the LD2410.
LD2410Types::ConfigData getConfigData() const
Returns a clone of the current configuration data of the radar.
bool requestAllConfigSettingsAsync(AsyncCommandCallback callback)
Requests all configuration settings from the sensor.
byte distanceGateStationarySensitivity[9]
Stationary sensitivity values per gate (0-100).
byte distanceGateMotionSensitivity[9]
Motion sensitivity values per gate (0-100).
unsigned short noOneTimeout
Timeout (seconds) until "no presence" is declared.