/* Code modified from http://matt16060936.blogspot.com/2012/04/attiny-pwm.html 10/27/15 attiny45 using internal 8MHz Oscillator H-bridge inputs: PB0, using 0C0A for PWM counterclockwise. PB1, using 0C0B for PWM clockwise. Fast PWM mode used, with PWM duty cycle determined by the values of registers 0CR0A and 0CR0B. See data sheet for details. */ #define F_CPU 8000000 #include #include int main(void) { uint8_t SetValue = 0; // // set clock divider to /1 // CLKPR = (1 << CLKPCE); CLKPR = (0 << CLKPS3) | (0 << CLKPS2) | (0 << CLKPS1) | (0 << CLKPS0); /* Control Register A for Timer/Counter-0 (Timer/Counter-0 is configured using two registers: A and B) TCCR0A is 8 bits: [COM0A1:COM0A0:COM0B1:COM0B0:unused:unused:WGM01:WGM00] 2<