
void mpr121Write(unsigned char address, unsigned char data)
{
i2cSendStart();
i2cWaitForComplete();
i2cSendByte(MPR121_W);// write 0xB4
i2cWaitForComplete();
i2cSendByte(address); // write register address
i2cWaitForComplete();
i2cSendByte(data);
i2cWaitForComplete();
i2cSendStop();
}
The
mpr121QuickConfig()
function is then defined. In this function, all 12
of the electrodes are enabled, and the touch and release thresholds for all
of the sensors are set. The filtering registers are also configured.
Page 21 of 24