setTimeout and LCD

Posted on
  • Hi Everyone,
    is it correct and intended that setTimeout prevents the screen to turn off, while setInterval isn't?
    Also there is an error in the API Reference of setTimeout (http://www.espruino.com/Reference#l__glo­bal_setTimeout)

    If you want to stop the function from being called, pass the number that was returned by setTimeout into the clearInterval function.

    I think the function clearTimeout is meant here. Also if my statement above is correct it would be nice to have it documented :)

  • is it correct and intended that setTimeout prevents the screen to turn off

    No, it's not intended at all, and I'm pretty convinced that isn't the case :) Are you calling g.flip()? I know that can prevent the screen from turning off...

    If you want to stop the function from being called, pass the number that was returned by setTimeout into the clearInterval function.

    Thanks! Both will work I believe as they are the same function, but that is still confusing. I'll change the docs

  • Oh okay, yeah g.flip() is prolly the reason in my case.

  • I remember using the LEDs will keep the screen on. Worth checking.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

setTimeout and LCD

Posted by Avatar for sauerman @sauerman

Actions