I’ve attempted to disable the green LED by setting the debug mode to 0 but the LED is always on.
If the person sensor does not detect a person prior to my setting the debug mode to 0, the LED stays off.
It seems that whatever state the LED is in at the time debug mode is disabled, the LED remains in that condition (off or on).
I can’t be sure that it hasn’t detected a person prior to my setting the debug mode to disabled.
Is their a reset command?
Any suggestions?
I would post my inquire at Useful Sensors web site but there doesn’t seem to be any link on their site for feedback.
You could try either physically disabling the LED or posting an issue here https://github.com/usefulsensors/ID-Demo/issues and see if they have a suggestion
I’m running into a similar issue. Ideally would like to know if one can read the value of the configuration registers. For example read the value of the debug register, toggle it and set it to the new value. However, even when the LED is on indicating a face detected, reading the value of the register returns 0x00. When setting the value I run into the same “instability” as the OP. I looked over at the issue tracker on GitHub but all issues are open and have no responses so it does not seem as if Useful Sensors is monitoring them.
This ToggleDebug() function does not work as one expects:
// Writes the value to the sensor register over the I2C bus.
inline void person_sensor_write_reg(uint8_t reg, uint8_t value)
{
Wire.beginTransmission(PERSON_SENSOR_I2C_ADDRESS);
Wire.write(reg);
Wire.write(value);
Wire.endTransmission();
}
uint8_t ToggleDebug()
{
Wire.beginTransmission(PERSON_SENSOR_I2C_ADDRESS);
Wire.write(PERSON_SENSOR_REG_DEBUG_MODE);
Wire.requestFrom(PERSON_SENSOR_I2C_ADDRESS, 1);
uint8_t debug = Wire.read();
Wire.endTransmission();
Serial.print(F("Debug: "));Serial.print(debug);
debug = debug == 0x01 ? 0x00 : 0x01;
person_sensor_write_reg(PERSON_SENSOR_REG_DEBUG_MODE, debug);
Wire.beginTransmission(PERSON_SENSOR_I2C_ADDRESS);
Wire.write(PERSON_SENSOR_REG_DEBUG_MODE);
Wire.requestFrom(PERSON_SENSOR_I2C_ADDRESS, 1);
debug = Wire.read();
Wire.endTransmission();
Serial.print(F(", "));Serial.println(debug);
return(debug);
}
Output after calling ToggleDebug() three times in a row:
Debug: 0, 0
Debug: 0, 0
Debug: 0, 0