Home › Forums › Mayfly Data Logger › LSM303 Accelerometer + Compass library integration into ModularSensors › Reply To: LSM303 Accelerometer + Compass library integration into ModularSensors
You definitely want to update for calculated variables. There’s a big bug in 0.19.6 in the “completeUpdate” function in run inside the “logData” function that will make any calculated variables crash.
After you update, adding the compass as a “calculated” variable should work just as you described. That is, you could call the begin and update to return a float in the calcFxn – and you would not be able to get averages or multiple readings without writing it yourself in the function. The calculated variable function are not called until after all the sensors have completed all measurements and gone to sleep.
You could look at the BME’s code if you want to try and write it as a new sensor. I need to write up better documentation on how to create a new sensor.