Test machine.idle() - fw 1.4.0.b1



  • Hi

    I want to reduce the power consumption to do some field tests of the LoPy device. So I included the new implemented machine.idle() command to my SW. But I couldn't remark an impact to the battery lifetime.

    So I want to analyze the function a little closer with this simple code:

    import machine
    from machine import Timer
    from machine import Pin
    #import pycom
    
    #Initiate LED
    led = Pin('G16', mode=Pin.OUT)
    
    #Init board
    #pycom.heartbeat(False)
    
    
    def drip(p):
        led.toggle()
        machine.idle()
            
    #Init Alarm
    alarm = Timer.Alarm(drip, 30,  periodic=True)
    

    In that example the heartbeat is always flashing, as well during the time of machine.idle(). Should it do that? Remains one core of the CPU active?
    Does anybody got a remarkable drop of energy consumption, by using machine.idle()? Do I use the function in a wrong way?


Log in to reply
 

Pycom on Twitter