Accelerometer modes
There are seven work modes for the accelerometer:
On
Power Down
Low power 1
Low power 2
Low power 3
Low power 4
Low power 5
To change between these modes, there are two functions that have been developed.
Setting accelerometer mode
It sets the accelerometer's work mode. It configures the accelerometer to a new work mode, where the possibilities are:
ACC_ON
Normal mode: Output data rate 50 HzACC_POWER_DOWN
Turn power offACC_LOW_POWER_1
Low power mode: Output data rate 0.5 HzACC_LOW_POWER_2
Low power mode: Output data rate 1 HzACC_LOW_POWER_3
Low power mode: Output data rate 2 HzACC_LOW_POWER_4
Low power mode: Output data rate 5 HzACC_LOW_POWER_5
Low power mode: Output data rate 10 Hz
Since it calls writeRegister()
, it will not activate any flags by itself, but the other functions will activate ACC_ERROR_READING
in case there was an error communicating to the register.
Example of use:
Related variable:
accMode
→ stores the work mode
Getting accelerometer mode
It checks accelerometer's work mode.
It returns the value for the accelerometer's work mode, the possibilities are:
ACC_ON
Normal mode: Output data rate 50 HzACC_POWER_DOWN
Turn power offACC_LOW_POWER_1
Low power mode: Output data rate 0.5 HzACC_LOW_POWER_2
Low power mode: Output data rate 1 HzACC_LOW_POWER_3
Low power mode: Output data rate 2 HzACC_LOW_POWER_4
Low power mode: Output data rate 5 HzACC_LOW_POWER_5
Low power mode: Output data rate 10 Hz
It does not call any other functions and therefore it will not activate any flags.
Example of use:
Last updated