<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Test machine.idle() - fw 1.4.0.b1]]></title><description><![CDATA[<p dir="auto">Hi</p>
<p dir="auto">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.</p>
<p dir="auto">So I want to analyze the function a little closer with this simple code:</p>
<pre><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)
</code></pre>
<p dir="auto">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?<br />
Does anybody got a remarkable drop of energy consumption, by using machine.idle()? Do I use the function in a wrong way?</p>
]]></description><link>https://forum.pycom.io/topic/536/test-machine-idle-fw-1-4-0-b1</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Mar 2026 14:11:48 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/536.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 22 Jan 2017 13:04:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Test machine.idle() - fw 1.4.0.b1 on Sun, 22 Jan 2017 13:04:23 GMT]]></title><description><![CDATA[<p dir="auto">Hi</p>
<p dir="auto">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.</p>
<p dir="auto">So I want to analyze the function a little closer with this simple code:</p>
<pre><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)
</code></pre>
<p dir="auto">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?<br />
Does anybody got a remarkable drop of energy consumption, by using machine.idle()? Do I use the function in a wrong way?</p>
]]></description><link>https://forum.pycom.io/post/3303</link><guid isPermaLink="true">https://forum.pycom.io/post/3303</guid><dc:creator><![CDATA[affoltep]]></dc:creator><pubDate>Sun, 22 Jan 2017 13:04:23 GMT</pubDate></item></channel></rss>