I am a newbie at using i2C and working with registers and reading and writing bits. I am trying to create python program that will use an MMA8452Q accelerometer to measure the vibration produced by a device I am testing. I have managed to get a program that spits out some data, but I am not getting all the data. I am pretty sure I am being limited by how I have the code set up.
After reading through the spec sheet, I know I can set the data rate up to 800Hz and that I can poll the accelerometer to tell me when new data is available. When the status of the ZYXDR bit changes new data is available but I don't know how to monitor the status of that bit.
The read commands for I2C over SMBus seem to be reading the whole register at one time.
read_byte_data(addr,cmd)
How do I know that just one bit has changed?