hi, wanted to use this module again,
used this code on the green Espruino
I2C1.setup({ scl : B6, sda: B7} );
var ads = require("ADS1X15").connect(I2C1); // <--- this now pulls everything from the internet
ads.setGain(4096); // +/- 0.256mV
ads.getADC(0, function(val) {
console.log("Reading: "+val);
});
function everySecond() {
ads.getADC(0, function(val0) {
ads.getADC(1, function(val1) {
ads.getADC(2, function(val2) {
ads.getADC(3, function(val3) {
console.log(val0,val1,val2,val3);
});
});
});
});
}
setInterval(everySecond, 1000);
and got this error
in function called from system
Uncaught Error: Invalid differential channelSpec 0
at line 1 col 157
...ifferential channelSpec "+a);c|=e}c|=d[this.gain];this.write...
^
in function "getADC" called from line 10 col 7
});
^
before it was working well
is something wrong with the code? or module from "require function"?
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.
hi, wanted to use this module again,
used this code on the green Espruino
and got this error
before it was working well
is something wrong with the code? or module from "require function"?