My code is a bit lengthy so I'll just link the relevant parts. My accelerometers (ADXL-362) have been working fine for months now - two days ago, I made a few changes and this morning all of them stopped working completely for some reason. I tested a few and I think they actually are permanently damaged, which makes me believe I did something wrong in my firmware.
Please forgive me if this post seems a bit unorganized - I'm really having trouble figuring out what happened here
I have this in the beginning of my code:
xl.begin(SS);
xl.beginMeasure();
xl.setupDCActivityInterrupt(300, 10);
xl.setupDCInactivityInterrupt(80, 400);
xl.SPIwriteOneRegister(0x2B, 0x40);
xl.SPIwriteOneRegister(0x27, 0x3F);
byte POWER_CTL_reg = xl.SPIreadOneRegister(0x2D);
POWER_CTL_reg = POWER_CTL_reg | (0x04);
xl.SPIwriteOneRegister(0x2D, POWER_CTL_reg);
xl.checkAllControlRegs();
I then have the following towards the end of my code:
xl.beginMeasure();
xl.setupDCActivityInterrupt(500, 10);
xl.setupDCInactivityInterrupt(150, 10);
xl.SPIwriteOneRegister(0x2A, 0x40);
xl.SPIwriteOneRegister(0x27, 0x3F);
byte POWER_CTL_reg = xl.SPIreadOneRegister(0x2D);
POWER_CTL_reg = POWER_CTL_reg | (0x04);
xl.SPIwriteOneRegister(0x2D, POWER_CTL_reg);
xl.checkAllControlRegs();
Part 2 is always run - Part 1 only in some circumstances.
Since this is the main thing I changed about my accelerometers recently, it's my prime suspect. My thought is that something in here could potentially have killed off all of them over time?