So far the Arduino code for the LSM9DS1 has been ported to Espruino, but to make it really useful it should be worked into module form.
There are a lot of knobs on the virtual control panel for this chip. In the previous version any changes to the knobs needed to be edited in the LSM9DS1.prototype.init function.
Today the code is modified so that the knobs are initialized to default values and an optional set of options can be supplied to the LSM9DS1.prototype.init function.
This is accomplished by changing the init function to the following
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
So far the Arduino code for the LSM9DS1 has been ported to Espruino, but to make it really useful it should be worked into module form.
There are a lot of knobs on the virtual control panel for this chip. In the previous version any changes to the knobs needed to be edited in the LSM9DS1.prototype.init function.
Today the code is modified so that the knobs are initialized to default values and an optional set of options can be supplied to the LSM9DS1.prototype.init function.
This is accomplished by changing the init function to the following
The optional options are outlined in the attached file options.js.
For example to change the acceleration sample rate from 6 to 5 :
The code that calls the init function uses an option object containing only the options we wish to change.
The output of the substitutions made in the init function:
2 Attachments