mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-13 16:42:07 +00:00
New detection sensor trigger type value
This commit is contained in:
parent
d1138d51e5
commit
a7c379961a
@ -472,7 +472,7 @@ void NodeDB::installDefaultModuleConfig()
|
|||||||
|
|
||||||
moduleConfig.has_detection_sensor = true;
|
moduleConfig.has_detection_sensor = true;
|
||||||
moduleConfig.detection_sensor.enabled = false;
|
moduleConfig.detection_sensor.enabled = false;
|
||||||
moduleConfig.detection_sensor.detection_triggered_high = true;
|
moduleConfig.detection_sensor.detection_trigger_type = meshtastic_ModuleConfig_DetectionSensorConfig_TriggerType_LOGIC_HIGH;
|
||||||
moduleConfig.detection_sensor.minimum_broadcast_secs = 45;
|
moduleConfig.detection_sensor.minimum_broadcast_secs = 45;
|
||||||
|
|
||||||
moduleConfig.has_ambient_lighting = true;
|
moduleConfig.has_ambient_lighting = true;
|
||||||
|
@ -108,5 +108,5 @@ bool DetectionSensorModule::hasDetectionEvent()
|
|||||||
{
|
{
|
||||||
bool currentState = digitalRead(moduleConfig.detection_sensor.monitor_pin);
|
bool currentState = digitalRead(moduleConfig.detection_sensor.monitor_pin);
|
||||||
// LOG_DEBUG("Detection Sensor Module: Current state: %i\n", currentState);
|
// LOG_DEBUG("Detection Sensor Module: Current state: %i\n", currentState);
|
||||||
return moduleConfig.detection_sensor.detection_triggered_high ? currentState : !currentState;
|
return moduleConfig.detection_sensor.detection_trigger_type ? currentState : !currentState;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user