<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>tricks on Bald Engineer</title><link>https://www.baldengineer.com/tag/tricks</link><description>Recent content in tricks on Bald Engineer</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 24 Mar 2015 18:04:38 +0000</lastBuildDate><atom:link href="https://www.baldengineer.com/tag/tricks/index.xml" rel="self" type="application/rss+xml"/><item><title>Arduino: Toggling Outputs</title><link>https://www.baldengineer.com/arduino-toggling-outputs.html</link><pubDate>Mon, 23 Jul 2012 09:00:13 +0000</pubDate><guid isPermaLink="false">https://www.baldengineer.com/?p=1072</guid><description>&lt;p&gt;Did you know it is possible to toggle the state of a Arduino OUTPUT pin using a single line of code?  It&amp;rsquo;s true!  It&amp;rsquo;s also possible to use digitalRead() on an OUTPUT pin.  Assuming pin 13 was set to output, this single line of code will cause the LED to change state (or flash) each time it is called:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-c" data-lang="c"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nf"&gt;digitalWrite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;digitalRead&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Keep reading to understand how these two tricks work.&lt;/p&gt;</description></item></channel></rss>