public
Created

Arduino workshop: szoftveres teljesítménynövelés (2012. december 13.)

  • Download Gist
serial.c
C
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <avr/io.h>
 
int main() {
UBRR0H = 0;
UBRR0L = 103;
UCSR0B = (1<<RXEN0)|(1<<TXEN0);
UCSR0C = (1<<USBS0)|(3<<UCSZ00);
while (1) {
/* Wait for empty transmit buffer */
while ( !( UCSR0A & (1<<UDRE0)) );
UDR0 = 0x55;
UCSR0B = (1<<RXEN0)|(1<<TXEN0);
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.