#define F_CPU 16000000UL #include #include int main(void) { DDRB |= (1 << PB1); TCCR1A = (1 << COM1A1) | (1 << WGM11); TCCR1B = (1 << WGM13) | (1 << WGM12) | (1 << CS11) | (1 << CS10); ICR1 = 4999; const uint16_t angles[5] = {250, 312, 375, 437, 500}; while (1) { for (uint8_t i = 0; i < 5; i++) { OCR1A = angles[i]; _delay_ms(1000); } for (uint8_t i = 5; i > 0; i--) { OCR1A = angles[i - 1]; _delay_ms(1000); } } }