I am receiving this error and don't know why or how to fix this:
Uncaught InternalError: Timeout on ADC at line 6 col 30 var vOut =
E.getAnalogVRef() * E.sum(view)/(view.length*65...
Code:
var w = new Waveform(128/* your buffer size */,{doubleBuffer:true, bits:16});
w.on("buffer", function(myarr) {
myarr.sort();
// cut off first and last 2 elements
var view = new Uint16Array(myarr.buffer, 2/*sizeof(uint16)*/*2, n-4);
var vOut = E.getAnalogVRef() * E.sum(view)/(view.length*65536); // if you attached VOUT to Ao
var vZero = 0.4;
var tCoeff = 19.5 / 1000;
var tempinc = (vOut - vZero) / tCoeff;
var tempinf = tempinc * (9 / 5) + 32;
console.log("Temp in C: " + tempinc);
console.log("Temp in F: " + tempinf);
//console.log(E.sum(view)/(view.length*65536));
});
w.startInput(A0,2000 /* Samples per second */,{repeat:true});
Console output:
Uncaught InternalError: Timeout on ADC at line 6 col 30 var vOut =
E.getAnalogVRef() * E.sum(view)/(view.length*65...
^ in function called from system Temp in C: 23.71055210571 Temp in F: 74.67899379028 Temp in C: 23.79099063384
Temp in F: 74.82378314091 Temp in C: 23.64845636164 Temp in F:
74.56722145096 Temp in C: 23.66374898568 Temp in F: 74.59474817422 Temp in C: 23.74768151969 Temp in F: 74.74582673545 Temp in C:
23.74994383879 Temp in F: 74.74989890983 Temp in C: 23.80151123724 Temp in F: 74.84272022703 Temp in C: 23.82175939511 Temp in F:
74.87916691119 Temp in C: 23.81015918605 Temp in F: 74.85828653489 Temp in C: 23.89451469519 Temp in F: 75.01012645134 Temp in C:
24.03446761515 Temp in F: 75.26204170727 Temp in C: 23.78549651722 Temp in F: 74.81389373101 Temp in C: 23.70157938435 Temp in F:
74.66284289184 Temp in C: 23.76887558668 Temp in F: 74.78397605602 Temp in C: 23.74900409502 Temp in F: 74.74820737105 Temp in C:
23.81278517307 Temp in F: 74.86301331153 Temp in C: 23.78265742766 Temp in F: 74.80878336979 Temp in C: 23.82784904577 Temp in F:
74.89012828240 Uncaught InternalError: Timeout on ADC at line 6 col 30 var vOut = E.getAnalogVRef() * E.sum(view)/(view.length*65...
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.
I am receiving this error and don't know why or how to fix this:
Code:
Console output: