electroZ microsystems

AVR/cookbook


Ecriture et lecture d'un port

DDRC  |=  _BV(0) | _BV(1); // Direction initialisation 1=out

button = PINC & _BV(2);    //Lecure bouton
if (button)       
{
   PORTC = _BV(0);        //Led rouge
}
else
{
   PORTC = _BV(1);        //Led verte
}     

printf

image:avr_printf.png