Hi
I'm trying to get MMA8452Q to trigger an interrupt when motion is detected and wonder if I'm missing something very obvious here.
So I setup CTRL_REG4 to 0x0B with
void MMA8452Q::setupISR()
{
writeRegister(CTRL_REG4, 0x0B);
}
then I setup FF_MT with
void MMA8452Q::setupFF_MT()
{
writeRegister(FF_MT_CFG, 0xF8);
writeRegister(FF_MT_THS, 0x0F);
writeRegister(FF_MT_COUNT, 0x00);
}
and I read ISR with
byte MMA8452Q::readISR()
{
byte intStat = readRegister(INT_SOURCE);
if (intStat & 0x0B)
{
Serial.println(readRegister(FF_MT_SRC));
return intStat & 0x0B;
}
else
return 0;
}
AFAIK, that should already have FF/MT interrupt enabled. Even when I'm getting readings in FF_MT_SRC, I'm not picking up an interrupt in INT_SOURCE.
Am I missing something here?
Thanks