You are reading a single comment by @randunel and its replies. Click here to read the full conversation.
  • I created a LED dimming function (source code). It does what I expect it to do every DURATION miliseconds, with an exception. I added two console logs to highlight the problem, this is the line which does not work, clearInterval(stepInterval), logging ERROR: Unknown Interval.
    All the other clearIntervals seem to be working. Here is some sample output from the script:

    run to 1
    clearing stepInterval number 11
    ERROR: Unknown Interval
    should have cleared stepInterval number 11
    done 1.
    done 0.99
    run to 0
    clearing stepInterval number 13
    ERROR: Unknown Interval
    should have cleared stepInterval number 13
    done -0.
    done 0.01
    run to 1
    clearing stepInterval number 15
    ERROR: Unknown Interval
    should have cleared stepInterval number 15
    done 1.
    done 0.99
    run to 0
    clearing stepInterval number 17
    ERROR: Unknown Interval
    should have cleared stepInterval number 17
    done -0.
    done 0.01
    run to 1
    clearing stepInterval number 19
    ERROR: Unknown Interval
    should have cleared stepInterval number 19
    

    So the intervals keep adding up, I assume it will either run out of memory or gray dragons will come out of the espruino board.

    Any hints?

About

Avatar for randunel @randunel started