Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

Reply To: LSM303 Accelerometer + Compass library integration into ModularSensors

Home Forums Mayfly Data Logger LSM303 Accelerometer + Compass library integration into ModularSensors Reply To: LSM303 Accelerometer + Compass library integration into ModularSensors

#12855
Sara Damiano
Moderator

    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.