I have this code to blink an array (8-led) of led one after one:
#include <avr/io.h>
#include <avr/delay.h>
#define dela 500
int main (void)
{
DDRC = 0xFF;
for(int i=0; ; i++,i%=8)
{
PORTC |=(1<<i);
delay_ms(dela);
PORTC &= ~(1 << i);
delay_ms(dela);
}
}
I want to light up those led partially, like dimmed version of this, something like PWM
Now my question is how can I do that, how can I write analog output ?
Micro-controller : ATmega8A - PDIP
analogWrite()
like thing in avr as in arduino \$\endgroup\$