</p>
<h3>SETUP</h3>
<img alt="fritzing diagram" style="width: 200px; height: 300px;"
src="images/re-fritz.png" align="left" hspace="10">The common
(centre) terminal should be connected to a Pi ground.
<p>The A and B terminals may be connected to any spare gpios.</p>
<p>Here A to gpio18 (P1-12), common to ground (P1-20), B to gpio7
(P1-26).<br clear="all"></p>
<p><img src="images/re-photo.jpg" style=
"width: 400px; height: 300px;" alt="photo of set-up"></p>
<h3>CODE</h3>
<code>#include &lt;stdio.h&gt;<br>
<b