@Gordon, line 98 is the culprit. config |= GAINS[this.gain]; (vs config |= this.gain;) will do it.
...and for the sake of consistency (of storing and usage application passed values vs derived values), line 74 has to read this.gain = 2048; (vs this.gain = 0;).
...Config ... carefully arranged... to totally remove needs a separate discussion.
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.
@Gordon, line 98 is the culprit.
config |= GAINS[this.gain];
(vs config |= this.gain;) will do it....and for the sake of consistency (of storing and usage application passed values vs derived values), line 74 has to read
this.gain = 2048;
(vs this.gain = 0;)....Config ... carefully arranged... to totally remove needs a separate discussion.