I'm also doing analogWrite(LED1, xxx) elsewhere in my code, if that makes a difference.
Ahh, you didn't mention that bit ;) Just normal analogWrite, or the forced software version?
Did you experiment with different timeouts? I'm not sure how I feel about this - making Puck.light 10 times slower just to deal with the very first reading in the case where someone is using analogWrite and Puck.light may not actually be in most people's best interests :)
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.
Ahh, you didn't mention that bit ;) Just normal analogWrite, or the forced software version?
Did you experiment with different timeouts? I'm not sure how I feel about this - making
Puck.light
10 times slower just to deal with the very first reading in the case where someone is usinganalogWrite
andPuck.light
may not actually be in most people's best interests :)