adafruit / Adafruit_LSM6DS

Arduino library for LSM6DS
Other
47 stars 39 forks source link

make acc{X,Y,Z} and gyro{X,Y,Z} public #32

Closed eringerli closed 2 years ago

eringerli commented 2 years ago

When rawAcc{X,Y,Z} and rawGyro{X,Y,Z} are public, the converted values acc{X,Y,Z} and gyro{X,Y,Z} should be too.

caternuson commented 2 years ago

Should this maybe go the other way? Make rawAcc{X,Y,Z} and rawGyro{X,Y,Z} protected? I think the intent is to access the sensor values using getEvent(), and not directly via these data members.

eringerli commented 2 years ago

It depends: I read the sensor with 1.66kHz, so less overhead is better. I'd like to call _read() and get the data out of the class via protected access. PR #34 adds a method to read out the gyro and magnetometer directly via references, which helps a lot. Now I have to create a small class which inherits from ISM330 so I can get access to the floats.

caternuson commented 2 years ago

Ah, OK - it helps with reading fast. There's not a lot else extra going on with with getEvent(), but the minor amount there sounds like it's enough to slow things down.

This seems benign. And can easily change back if this expose some odd regression.