Retune acceleromter to be more sensive
This commit is contained in:
@@ -38,7 +38,7 @@ void StartUp_Acceleromter(void) {
|
|||||||
I2C_RegisterWrite( CTRL_REG2, 0x40); // Reset all registers to POR values
|
I2C_RegisterWrite( CTRL_REG2, 0x40); // Reset all registers to POR values
|
||||||
delayMs(2); // ~1ms delay
|
delayMs(2); // ~1ms delay
|
||||||
I2C_RegisterWrite(FF_MT_CFG_REG, 0x78);// Enable motion detection for X and Y axis, latch enabled
|
I2C_RegisterWrite(FF_MT_CFG_REG, 0x78);// Enable motion detection for X and Y axis, latch enabled
|
||||||
I2C_RegisterWrite(FF_MT_THS_REG, 0x10); // Set threshold to about 0.25g
|
I2C_RegisterWrite(FF_MT_THS_REG, 0x0F); // Set threshold
|
||||||
I2C_RegisterWrite(FF_MT_COUNT_REG, 0x01); // Set debounce to 100ms
|
I2C_RegisterWrite(FF_MT_COUNT_REG, 0x01); // Set debounce to 100ms
|
||||||
|
|
||||||
I2C_RegisterWrite( CTRL_REG4, 0x04); // Enable motion interrupt
|
I2C_RegisterWrite( CTRL_REG4, 0x04); // Enable motion interrupt
|
||||||
|
|||||||
@@ -48,9 +48,9 @@ void ProcessUI() {
|
|||||||
//We need to check the timer for movement in case we need to goto idle
|
//We need to check the timer for movement in case we need to goto idle
|
||||||
if (systemSettings.movementEnabled)
|
if (systemSettings.movementEnabled)
|
||||||
if (millis() - getLastMovement()
|
if (millis() - getLastMovement()
|
||||||
> (systemSettings.SleepTime * 10000)) {
|
> (systemSettings.SleepTime * 60000)) {
|
||||||
if (millis() - getLastButtonPress()
|
if (millis() - getLastButtonPress()
|
||||||
> (systemSettings.SleepTime * 10000)) {
|
> (systemSettings.SleepTime * 60000)) {
|
||||||
operatingMode = SLEEP;
|
operatingMode = SLEEP;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user