Anyone having trouble with analogWrite? The following code produces a blinking LED, but no fading:
int value = 0; // variable to keep the actual value
int pin = 13; // light connected to analog pin 0
void setup()
{
// nothing for setup
}
void loop()
{
for(value = 0 ; value <= 255; value+=1) // fade in (from min to max)
{
analogWrite(pin, value); // sets the value (range from 0 to 255)
delay(30); // waits for 30 milli seconds to see the dimming effect
}
delay(500);
}