diff --git a/src/inverter.c b/src/inverter.c index 60d7dd1..172a7ce 100644 --- a/src/inverter.c +++ b/src/inverter.c @@ -14,45 +14,16 @@ int main() printf("Starting up!\r\n"); - DDRB |= (1<< DDB5); + /* + * We are using Timer 1 Compare Match Unit B. + * OC1B is on Pin PB6. Let's make it an output. + */ + DDRB |= (1 << DDB6); - DDRC |= (1 << DDC6); - - DDRD |= (1 << DDD0); - DDRD |= (1 << DDD1); - DDRD |= (1 << DDD7); - - unsetPin(&PORTC, PC6); - - unsetPin(&PORTD, PD0); - unsetPin(&PORTD, PD1); - unsetPin(&PORTD, PD7); - - // initCtcTimer0(); - // sei(); + initPwmTimer1(); while (1) { - _delay_ms(10); - - unsetPin(&PORTD, PD0); - unsetPin(&PORTD, PD1); - - _delay_us(1); - - setPin(&PORTC, PC6); - setPin(&PORTD, PC7); - setPin(&PORTB, PB5); - - _delay_ms(10); - unsetPin(&PORTC, PC6); - unsetPin(&PORTD, PC7); - unsetPin(&PORTB, PB5); - - _delay_us(1); - - setPin(&PORTD, PD0); - setPin(&PORTD, PD1); } return 0;