You are reading a single comment by @pankleks and its replies. Click here to read the full conversation.
  • 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.

About

Avatar for pankleks @pankleks started