@DrAzzy: yes, that could be your issue - however I'd have thought that Espruino would have been able to consume some of the events before the queue got full?
@CamSwords: The reason that the queue is getting full is almost certainly the serial output: If you're writing data out down Serial and Espruino's output buffer gets full, print/console.log waits for there to be enough space in the queue to put in what you're sending (rather than throwing it away).
If you're getting signals every 20ms and the buffer is getting full, that's roughly 20*32 = 640ms since you last went around the idle loop. Regardless of whether you're getting the right values or not, a 640ms delay in response time for a quadcopter is going to be disasterous!
What about:
modifying your print statement to print out only every 10th value
using myvalue.toFixed(2) to restrict the number of decimal places to 2.
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.
@DrAzzy: yes, that could be your issue - however I'd have thought that Espruino would have been able to consume some of the events before the queue got full?
@CamSwords: The reason that the queue is getting full is almost certainly the serial output: If you're writing data out down Serial and Espruino's output buffer gets full,
print/console.log
waits for there to be enough space in the queue to put in what you're sending (rather than throwing it away).If you're getting signals every 20ms and the buffer is getting full, that's roughly
20*32 = 640ms
since you last went around the idle loop. Regardless of whether you're getting the right values or not, a 640ms delay in response time for a quadcopter is going to be disasterous!What about:
print
statement to print out only every 10th valuemyvalue.toFixed(2)
to restrict the number of decimal places to 2.