So what am I missing?
Code: Select all
int ledPin = 13; // LED connected to digital pin 9
void setup() {
// nothing happens in setup
// wanna bet, plinko?
Serial.begin(9600);
Serial.println("And so it begins.");
}
void loop() {
// fade in from min to max in increments of 5 points:
for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
Serial.println(fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
// fade out from max to min in increments of 5 points:
for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
Serial.println(fadeValue);
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
}
Nate
<EDIT>
Same code does work with an LED hooked to pin 10 which is marked with a ~, so now I wonder if the bootloader is Captain Specialpants and is the only thing able to fade pin 13?
</EDIT>