• Hey guys,

    Thank you so much for taking the time to have a look at my code:

    @allObjects

    Good tips for debugging. I'll add an on handler.

    L24 .bind(this) , I add these to every nested function to maintain function scope to avoid things like var temp = this etc.

    I've read about places to put the WiFi creds and yes I'll do that when i'm happy its working well.

    @Robin

    If it's bad data or an out of range error, wouldn't that crash the whole thing? I mentioned that the Espruino is still calling the Pi4 every 3 seconds even after display stops, so surely there's no error here? Or could it be repeatedly throwing an error but still making calls?

    Yes setInterval does return an integer, but JS will coerce this to false if 0 and true if its any value greater than 0, so I believe this is correct.

    Good tip about the process.memory() call and the try catch.

    Really appreciate the advice, will see what I can find out and report back.

  • Glad you got it all sorted out, and in a short period of time to boot!

    'Yes setInterval does return an integer, but JS will coerce this to false if 0 and true if its any value greater than 0, so I believe this is correct.'

    Just to clarify for others reading along, that statement would hold true for the test condition using if(). However, it was the use of the argument value for var interval that would cause an error with the clearInterval() function, which requires the timer ID which you have identified is numeric. Was it also realized that the interval argument is never used/reset?

    http://www.espruino.com/Reference#l__glo­bal_clearInterval


    'That test there sometimes didn't reset i = 8'

    re: L46   So was it just a simple <=?

About

Avatar for Coder2012 @Coder2012 started