1
0
forked from me/IronOS

Retune acceleromter to be more sensive

This commit is contained in:
Ben V. Brown
2016-09-29 13:44:14 +10:00
parent 5a581b7a9f
commit 718cfc4612
2 changed files with 3 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ void StartUp_Acceleromter(void) {
I2C_RegisterWrite( CTRL_REG2, 0x40); // Reset all registers to POR values
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_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( CTRL_REG4, 0x04); // Enable motion interrupt

View File

@@ -48,9 +48,9 @@ void ProcessUI() {
//We need to check the timer for movement in case we need to goto idle
if (systemSettings.movementEnabled)
if (millis() - getLastMovement()
> (systemSettings.SleepTime * 10000)) {
> (systemSettings.SleepTime * 60000)) {
if (millis() - getLastButtonPress()
> (systemSettings.SleepTime * 10000)) {
> (systemSettings.SleepTime * 60000)) {
operatingMode = SLEEP;
return;
}