Quantcast
Channel: Microcontrollers, Programming and IoT
Viewing all articles
Browse latest Browse all 1271

PWM led without timer

$
0
0
Hi. How can i do smooth pwm using delay loops ? I tied like this:

int period;
int i=0;

while
{
i++;
Turn_LED_off();
_delay(i);
Turn_LED_on();
_delay(period-i);

if (i>=period)
{
i=0;

}
}
It works bad....

Viewing all articles
Browse latest Browse all 1271

Trending Articles