You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use single dataReady() method, instead of accelDataReady/gyroDataReady
This method is a bit more flexible. There is a version with no
parameters, which will return true if all enabled sensors have new
data. There is one overload, that takes a single 'flags' parameter,
which returns true if all enabled *and* selected sensors have new data.
Sensors are selectable through bit flags. For example;
CurieIMU.dataReady() : this will return true if both the accel and gyro
are enabled, and both have new data ready.
CurieIMU.dataReady(ACCEL | GYRO) : this will return true if both the
accel and gyro are enabled, and both have new data ready.
CurieIMU.dataReady(GYRO) : this will return true if the gyro is
enabled and has new data ready.
CurieIMU.dataReady(ACCEL) : this will return true if the accel is
enabled and has new data ready.
This also involved changing the 'begin' method to allow selective
enabling of sensors, e.g.
CurieIMU.begin() : same as it always has, initializes IMU, enabling
both accel and gyro
CurieIMU.begin(ACCEL | GYRO) : initializes IMU, enabling both accel
and gyro
CurieIMU.begin(ACCEL) : initializes IMU, enabling accel only
0 commit comments