33 lines
474 B
C
33 lines
474 B
C
#include <avr/io.h>
|
|
#include <util/delay.h>
|
|
#include <avr/interrupt.h>
|
|
|
|
#include "include/uart.h"
|
|
#include "include/timer.h"
|
|
#include "include/commands.h"
|
|
|
|
int main()
|
|
{
|
|
/* With this MCU frequency, it is 38,4k baud */
|
|
uart_init(12);
|
|
|
|
printf("Starting up!\r\n");
|
|
|
|
/* Make PB2 an output pin */
|
|
DDRB |= (1 << DDB2);
|
|
DDRD |= (1 << DDD6);
|
|
|
|
initCtcTimer0();
|
|
|
|
sei();
|
|
|
|
while (1) {
|
|
if ((PORTB & (1<<PB2))>1) {
|
|
_delay_us(1);
|
|
PORTB &= ~(1<<PB2);
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
}
|