Well @maze1980 and @allObjects I do understand sleep vs setInterval + event loop in JS differnces.
Still I don't understand why following code in micropython:
led = Pin(13, Pin.OUT)
def blink():
led.value(not led.value())
t = time.ticks_ms();
while True:
if (time.ticks_ms() - t >= 1000):
blink();
print((esp32.raw_temperature() - 32) * 0.5556)
t = time.ticks_ms()
produces same 51 C
I clearly I'm not putting ESP to sleep, and in a sense it's more or less what main event loop + setInterval would be doing.
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.
Well @maze1980 and @allObjects I do understand
sleep
vssetInterval
+ event loop in JS differnces.Still I don't understand why following code in micropython:
produces same 51 C
I clearly I'm not putting ESP to sleep, and in a sense it's more or less what main event loop +
setInterval
would be doing.