<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Arduino Millis() Rollover Handling</title>
	<atom:link href="http://www.faludi.com/2007/12/18/arduino-millis-rollover-handling/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.faludi.com/2007/12/18/arduino-millis-rollover-handling/</link>
	<description></description>
	<pubDate>Thu, 04 Dec 2008 21:19:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: faludi</title>
		<link>http://www.faludi.com/2007/12/18/arduino-millis-rollover-handling/#comment-548</link>
		<dc:creator>faludi</dc:creator>
		<pubDate>Mon, 24 Nov 2008 02:27:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.faludi.com/2007/12/18/arduino-millis-rollover-handling/#comment-548</guid>
		<description>Glad you asked because it's worth noting that the millis() function was greatly improved in Arduino 0012:

* Improved millis(): it now overflows after 49 days instead of 9 hours, but
  now uses slightly more processing power.

I'm assuming this means that it now fills the full unsigned long variable. So in your case you should just be able to do the math. The rollover will cause your subtraction to overflow an the result would be correct.</description>
		<content:encoded><![CDATA[<p>Glad you asked because it&#8217;s worth noting that the millis() function was greatly improved in Arduino 0012:</p>
<p>* Improved millis(): it now overflows after 49 days instead of 9 hours, but<br />
  now uses slightly more processing power.</p>
<p>I&#8217;m assuming this means that it now fills the full unsigned long variable. So in your case you should just be able to do the math. The rollover will cause your subtraction to overflow an the result would be correct.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.faludi.com/2007/12/18/arduino-millis-rollover-handling/#comment-547</link>
		<dc:creator>John</dc:creator>
		<pubDate>Mon, 24 Nov 2008 01:59:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.faludi.com/2007/12/18/arduino-millis-rollover-handling/#comment-547</guid>
		<description>I'm having a little difficulty understanding how I would use your rollover function in a scenario where I tick a clock if 1000 ms has elapsed, like:

if( millis() - previousMillis &#62; 1000 ) {
    previousMillis = millis();
    // One second has elapsed, tick the clock.
}

It seems like this will "hiccup" during a rollover.</description>
		<content:encoded><![CDATA[<p>I&#8217;m having a little difficulty understanding how I would use your rollover function in a scenario where I tick a clock if 1000 ms has elapsed, like:</p>
<p>if( millis() - previousMillis &gt; 1000 ) {<br />
    previousMillis = millis();<br />
    // One second has elapsed, tick the clock.<br />
}</p>
<p>It seems like this will &#8220;hiccup&#8221; during a rollover.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
