<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>blinking on Bald Engineer</title><link>https://www.baldengineer.com/tag/blinking</link><description>Recent content in blinking on Bald Engineer</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Wed, 11 Apr 2018 04:50:54 +0000</lastBuildDate><atom:link href="https://www.baldengineer.com/tag/blinking/index.xml" rel="self" type="application/rss+xml"/><item><title>Microcontroller state machine with enum tutorial</title><link>https://www.baldengineer.com/state-machine-with-enum-tutorial.html</link><pubDate>Wed, 29 Jul 2015 13:00:07 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=5251</guid><description>Flag variables are great, and totally not evil, when you just have two states: ON or OFF. What about when you have multiple states? Is there an option better than creating multiple flag variables?&#10;The C-language has a declaration type just for this purpose. It is called an enumeration, or enum.&#10;Setting up a state machine with enum is a surprisingly simple. Arduino and embedded programmers should use them!&#10;All you need to do is create descriptive tag names, and let the compiler assign them an integer value. Unlike a #define which is just a macro replacement, the compiler treats an enum as your personal variable type.<p><img src="https://www.baldengineer.com/wp-content/uploads/2015/07/state-machines-with-enum-tutorial.jpg" alt="Microcontroller state machine with enum tutorial"/></p></description></item><item><title>Pushbutton and Flashing LED tutorial with millis()</title><link>https://www.baldengineer.com/pushbutton-and-flashing-led-tutorial-with-millis.html</link><pubDate>Wed, 06 May 2015 14:00:21 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=4930</guid><description>How to blink (or flash) a LED without delay() and detect button pushes One of the limitations of the delay() function is that nothing else can really be done. This presents a problem when you want to flash a LED while waiting for a pushbutton to be pressed.&#10;Flashing the LED with millis() and using a flag variable to find if the LED should be flashing solves this problem.&#10;Consider this another example to my virtual millis() cookbook.<p><img src="https://www.baldengineer.com/wp-content/uploads/2015/05/pushbutton-and-millis_bb-fixed2.png" alt="Pushbutton and Flashing LED tutorial with millis()"/></p></description></item></channel></rss>