, int lev, uint32_t tick);<br>
<br>
int main(int argc, char * argv[])<br>
{<br>
&nbsp;&nbsp; int pos=0;<br>
<br>
&nbsp;&nbsp; if (gpioInitialise()&lt;0) return 1;<br>
<br>
&nbsp;&nbsp; gpioSetMode(ENCODER_A, PI_INPUT);<br>
&nbsp;&nbsp; gpioSetMode(ENCODER_B, PI_INPUT);<br>
<br>
&nbsp;&nbsp; /* pull up is needed as encoder common is grounded
*/<br>
<br>
&nbsp;&nbsp; gpioSetPullUpDown(ENCODER_A, PI_PUD_UP);<br>
&nbsp;&nbsp; gpioSetPullUpDown(ENCODER_B, PI_PUD_UP);<br>
<br>
&nbsp;&nbsp; encoderPos = pos;<br>
<