|
LD2410Async
Asynchronous Arduino ESP32 library for the LD2410 mmWave radar sensor
|
Go to the source code of this file.
Macros | |
| #define | RADAR_RX_PIN 16 |
| Example: Change configuration of the LD2410. | |
| #define | RADAR_TX_PIN 17 |
| #define | RADAR_BAUDRATE 256000 |
Functions | |
| HardwareSerial | RadarSerial (1) |
| void | onConfigApplied (LD2410Async *sender, LD2410Async::AsyncCommandResult result) |
| Callback after the new config has been written to the sensor. | |
| 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 | loop () |
| Arduino loop function which does nothing. | |
Variables | |
| LD2410Async | radar (RadarSerial) |
| Creates LD2410Async object bound to the serial port defined in RadarSerial. | |
| #define RADAR_BAUDRATE 256000 |
Definition at line 27 of file changeConfig.ino.
| #define RADAR_RX_PIN 16 |
Example: Change configuration of the LD2410.
This sketch shows how to:
Definition at line 23 of file changeConfig.ino.
| #define RADAR_TX_PIN 17 |
Definition at line 24 of file changeConfig.ino.
| void loop | ( | ) |
Arduino loop function which does nothing.
The LD2410Async library runs a FreeRTOS background task that automatically handles all jobs that are related to the radar sensor. Therefore the main loop doesnt have to da any LD2410 related work and is free for anything else you might want to do.
Definition at line 148 of file changeConfig.ino.
| void onConfigApplied | ( | LD2410Async * | sender, |
| LD2410Async::AsyncCommandResult | result ) |
Callback after the new config has been written to the sensor.
This method just checks and prints the result
Definition at line 47 of file changeConfig.ino.
| void onConfigReceived | ( | LD2410Async * | sender, |
| LD2410Async::AsyncCommandResult | result ) |
Callback after receiving the config data.
Checks the result of the async requestAllConfigSettingsAsync() command, gets a clone of the config data using getConfigData(), modifies it and writes back using the async configureAllConfigSettingsAsync() command.
Definition at line 69 of file changeConfig.ino.
| HardwareSerial RadarSerial | ( | 1 | ) |
Create a HardwareSerial instance (ESP32 has multiple UARTs) bound to UART1
| void setup | ( | ) |
Arduino setup function which initializes the radar and starts the config change process.
begin() starts the background task of the LD2410Async library which automatically handles incoming data and triggers callbacks. The onDetectionDataReceived callback is registered to receive detection data. requestAllConfigSettingsAsync() will fetch all config data from the sensor and triggers the onConfigReceived callback when done.
Definition at line 112 of file changeConfig.ino.
| LD2410Async radar(RadarSerial) | ( | RadarSerial | ) |
Creates LD2410Async object bound to the serial port defined in RadarSerial.