I am trying to save some values in the array but looks like Mongoose OS does not support .push() method in MJS. I have tried to use .splice() bit it does not seem to work. This is the code that I have
let arr = [];
let stId =Timer.set(0.5, Timer.REPEAT, function() {
let r = ADC.read(34);
arr.splice(arr.length,0,r);
if (arr.length > 100) {
Timer.del(stId);
print('array ', arr)
}
}, null);
@cpq No, it is supposed to be 0.5. I am trying to sample a 60Hz sinusoid signal. The problem is with arr.splice(arr.length,0,r);. It throws this error. Sorry for not posting it before