Fading the LED without turning it off.
hi, guys. i'm noob in arduino now.
i wonder, how can turn on led, using fade-effect. without turning off.
i use
but, after fading in, led turnes off , fade in again , again , forever. , other commands in code(after for-commands) don't work. how prevent turning off, until 'analogwrite(pwmpin, 0)' command.
thank you.
i wonder, how can turn on led, using fade-effect. without turning off.
i use
code: [select]
int pwmpin = 10; // led in series 470 ohm resistor on pin 10
void setup()
{
}
void loop()
{
(int i=0; <= 255; i++){
analogwrite(pwmpin, i);
delay(10);
}
}
but, after fading in, led turnes off , fade in again , again , forever. , other commands in code(after for-commands) don't work. how prevent turning off, until 'analogwrite(pwmpin, 0)' command.
thank you.
if " " equals 0 or if required minimal voltage not met, turn off.
Arduino Forum > Using Arduino > Programming Questions > Fading the LED without turning it off.
arduino
Comments
Post a Comment