You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • @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.
    • increasing the serial port baud rate?
About

Avatar for Gordon @Gordon started