Avr Gcc

More information to AVR-GCC on http://www.mikrocontroller.net/articles/AVR-GCC-Tutorial !

<pre>
x |= (1 « bitnumber); // set bitnumber to 1
x &= ~(1 « bitnumber); // set bitnumber to 0
</pre>

Input Example:
<pre>
DDRA &= ~( (1«PA0) | (1«PA3) ); /* set PA0 and PA3 to 0 (Inputs) */
PORTA |= (1«PA0) | (1«PA3); /* switch internal pullups ON */
</pre>

Output Example:
<pre>
DDRA |= (1«PA0) | (1«PA3); /* set PA0 and PA3 to 1 (Outputs) */
PORTA |= (1«PA0) | (1«PA3); /* set outputs A0 and A3 to high */
</pre>

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License