<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>micros on Bald Engineer</title><link>https://www.baldengineer.com/tag/micros</link><description>Recent content in micros on Bald Engineer</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 03 Apr 2022 00:44:53 +0000</lastBuildDate><atom:link href="https://www.baldengineer.com/tag/micros/index.xml" rel="self" type="application/rss+xml"/><item><title>Proper Larson Scanner with Software PWM (Repost)</title><link>https://www.baldengineer.com/proper-larson-scanner-with-sw-pwm.html</link><pubDate>Wed, 21 Oct 2015 16:00:03 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=5501</guid><description>&lt;p&gt;Last week I had a &lt;a href="https://www.baldengineer.com/software-pwm-with-millis.html"&gt;detailed Arduino tutorial on software pulse width modulation&lt;/a&gt; using millis() and micros(). Why? Because I wanted to create a Proper Larson Scanner, with persistence and at least 8 LEDs.&lt;/p&gt;&#10;&lt;figure&gt;&lt;img src="https://www.baldengineer.com/wp-content/uploads/2015/10/knight-rider-season-3-218x300.jpg"&#10;&#9;&#9;&#9;alt="KITT larson scanner example"&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;KITT larson scanner example&lt;/p&gt;&#10;&#9;&#9;&lt;/figcaption&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;p&gt;Even though it is a popular project for the Arduino Uno, most Larson scanner tutorials, &lt;a href="https://www.baldengineer.com/arduino-chasing-leds-with-millis.html"&gt;like my first one&lt;/a&gt;, have a few flaws. First, there is no persistence, or tail, to the LED as it moves back and forth. Persistence could be solved by using pulse-width-modulation. The Uno and other 328p-based micros only have 6 Pulse Width Modulation (PWM) pins. And let&amp;rsquo;s be honest, every project is made better by adding more LEDs. :)&lt;/p&gt;</description></item><item><title>Arduino: De-Bounce a Button with micros() or millis()</title><link>https://www.baldengineer.com/arduino-de-bounce-a-button-with-micros.html</link><pubDate>Fri, 13 Dec 2013 12:25:45 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=2095</guid><description>&lt;p&gt;The Arduino is fast, humans are slow. When you push down a button, what seems like a single change to slow humans is really multiple presses to an Arduino.  This is known as &amp;ldquo;bouncing.&amp;rdquo;  Figure 1 is an oscilloscope screenshot showing what could happen when a button is pressed.&lt;/p&gt;&#10;&lt;figure class="aligncenter"&gt;&lt;a href="https://www.baldengineer.com/wp-content/uploads/2013/12/millis-oscilloscope-trace-button-bounce.png"&gt;&lt;img src="https://www.baldengineer.com/wp-content/uploads/2013/12/millis-oscilloscope-trace-button-bounce.png"&#10;&#9;&#9;&#9;alt="millis-oscilloscope-trace-button-bounce" width="320"&gt;&lt;/a&gt;&lt;figcaption&gt;&#10;&#9;&#9;&#9;&lt;p&gt;Figure 1 - All the bouncing!&lt;/p&gt;&#10;&#9;&#9;&lt;/figcaption&gt;&#10;&lt;/figure&gt;&#10;&#10;&lt;p&gt;The top trace shows the high-low-high transition of the button press.  But notice all of the activity at the start of the high-to-low transition.  The bottom trace is a &amp;ldquo;zoomed-in&amp;rdquo; view of that area.  The button is actually transitioning multiple times before staying low.  Internally the contacts are &amp;ldquo;bouncing.&amp;rdquo;  This could result in false reads.  In software, we can ignore these bounces by waiting some period of time after the first transition.&lt;/p&gt;</description></item></channel></rss>