66 static String targetStateToString(
TargetState state) {
75 default:
return "Unknown";
281 Serial.println(
"=== DetectionData ===");
283 Serial.print(
" Timestamp: ");
286 Serial.print(
" Engineering Mode: ");
289 Serial.print(
" Target State: ");
292 Serial.print(
" Moving Target Distance (cm): ");
295 Serial.print(
" Moving Target Signal: ");
298 Serial.print(
" Stationary Target Distance (cm): ");
301 Serial.print(
" Stationary Target Signal: ");
304 Serial.print(
" Detected Distance (cm): ");
307 Serial.print(
" Light Level: ");
310 Serial.print(
" OUT Pin Status: ");
315 Serial.println(
" --- Engineering Mode Data ---");
317 Serial.print(
" Moving Target Gate Signal Count: ");
320 Serial.print(
" Moving Target Gate Signals: ");
327 Serial.print(
" Stationary Target Gate Signal Count: ");
330 Serial.print(
" Stationary Target Gate Signals: ");
338 Serial.println(
"======================");
400 for (
int i = 0; i < 9; i++) {
424 for (
int i = 0; i < 9; i++) {
435 Serial.println(
"=== ConfigData ===");
437 Serial.print(
" Number of Gates: ");
440 Serial.print(
" Max Motion Distance Gate: ");
443 Serial.print(
" Max Stationary Distance Gate: ");
446 Serial.print(
" Motion Sensitivity: ");
447 for (
int i = 0; i < 9; i++) {
449 if (i < 8) Serial.print(
",");
453 Serial.print(
" Stationary Sensitivity: ");
454 for (
int i = 0; i < 9; i++) {
456 if (i < 8) Serial.print(
",");
460 Serial.print(
" No One Timeout: ");
463 Serial.print(
" Distance Resolution: ");
466 Serial.print(
" Light Threshold: ");
469 Serial.print(
" Light Control: ");
472 Serial.print(
" Output Control: ");
475 Serial.println(
"===================");
All enums, structs, and type helpers for LD2410Async.
AutoConfigStatus
State of the automatic threshold configuration routine.
@ NOT_SET
Status not yet retrieved.
@ COMPLETED
Auto-configuration finished (success or failure).
@ IN_PROGRESS
Auto-configuration is currently running.
@ NOT_IN_PROGRESS
Auto-configuration not running.
OutputControl
Logic level behavior of the auxiliary output pin.
@ NOT_SET
Placeholder for the initial value. Do not use as a config value (it will cause the configuration comm...
@ DEFAULT_HIGH_DETECTED_LOW
Default high, goes LOW when detection occurs.
@ DEFAULT_LOW_DETECTED_HIGH
Default low, goes HIGH when detection occurs.
@ BAUDRATE_57600
57600 baud.
@ BAUDRATE_38400
38400 baud.
@ BAUDRATE_230500
230400 baud.
@ BAUDRATE_115200
115200 baud.
@ BAUDRATE_256000
256000 baud (factory default).
@ BAUDRATE_19200
19200 baud.
@ BAUDRATE_9600
9600 baud.
@ BAUDRATE_460800
460800 baud (high-speed).
DistanceResolution
Distance resolution per gate for detection.
@ NOT_SET
Placeholder for the initial value. Do not use as a config value (it will cause the configuration comm...
@ RESOLUTION_20CM
Each gate is about 0.20 m, max range about 1.8 m.
@ RESOLUTION_75CM
Each gate is about 0.75 m, max range about 6 m.
TargetState
Represents the current target detection state reported by the radar.
@ MOVING_AND_STATIONARY_TARGET
Both moving and stationary targets detected.
@ NO_TARGET
No moving or stationary target detected.
@ AUTOCONFIG_IN_PROGRESS
Auto-configuration routine is running.
@ AUTOCONFIG_FAILED
Auto-configuration failed.
@ STATIONARY_TARGET
A stationary target has been detected.
@ MOVING_TARGET
A moving target has been detected.
@ AUTOCONFIG_SUCCESS
Auto-configuration completed successfully.
LightControl
Light-dependent control status of the auxiliary output.
@ NOT_SET
Placeholder for the initial value. Do not use as a config value (it will cause the configuration comm...
@ LIGHT_BELOW_THRESHOLD
Condition: light < threshold.
@ LIGHT_ABOVE_THRESHOLD
Condition: light >= threshold.
@ NO_LIGHT_CONTROL
Output is not influenced by light levels.
byte distanceGateStationarySensitivity[9]
Stationary sensitivity values per gate (0-100).
void print() const
Debug helper: print configuration contents to Serial.
byte distanceGateMotionSensitivity[9]
Motion sensitivity values per gate (0-100).
byte maxMotionDistanceGate
Furthest gate used for motion detection.
OutputControl outputControl
Logic configuration of the OUT pin.
bool equals(const ConfigData &other) const
Compares this ConfigData with another for equality.
byte lightThreshold
Threshold for auxiliary light control (0-255).
bool isValid() const
Validates the configuration data for correctness.
LightControl lightControl
Light-dependent auxiliary control mode.
byte maxStationaryDistanceGate
Furthest gate used for stationary detection.
byte numberOfGates
Number of distance gates (2-8). This member is read-only; changing its value will not influence the r...
DistanceResolution distanceResolution
Current distance resolution. A reboot is required to activate changes after configureAllConfigSetting...
unsigned short noOneTimeout
Timeout (seconds) until "no presence" is declared.
Holds the most recent detection data reported by the radar.
void print() const
Debug helper: print detection data contents to Serial.
byte stationaryTargetGateSignals[9]
Per-gate signal strengths for stationary targets.
bool engineeringMode
True if engineering mode data was received.
bool stationaryPresenceDetected
True if a stationary target is detected.
byte stationaryTargetSignal
Signal strength (0-100) of the stationary target.
byte lightLevel
Reported ambient light level (0-255).
unsigned int detectedDistance
General detection distance (cm).
byte movingTargetGateSignalCount
Number of gates with moving target signals.
TargetState targetState
Current detection state.
byte movingTargetGateSignals[9]
Per-gate signal strengths for moving targets.
byte stationaryTargetGateSignalCount
Number of gates with stationary target signals.
bool presenceDetected
True if any target is detected.
byte movingTargetSignal
Signal strength (0-100) of the moving target.
bool outPinStatus
Current status of the OUT pin (true = high, false = low).
unsigned long timestamp
Timestamp (ms since boot) when this data was received.
bool movingPresenceDetected
True if a moving target is detected.
unsigned int movingTargetDistance
Distance (cm) to the nearest moving target.
unsigned int stationaryTargetDistance
Distance (cm) to the nearest stationary target.
char bluetoothMacText[18]
MAC address as a human-readable string (e.g. "AA:BB:CC:DD:EE:FF").
uint16_t protocolVersion
Protocol version reported by the radar.
char firmwareText[16]
Firmware version string of the radar.
uint16_t bufferSize
Buffer size reported by the radar protocol.