4 LED an dig. Out. 6, 7, 8 und 9
Jeweils eine LED soll 1 sec. leuchten (High) sowie eine benachbarte (pulseWith)
(Das funktioniert aber nur für LED 7 und 9 High + benachbarte LED
Wo liegt der Fehler?
int pulseWidth = 10; // Any value between 0 and 255
void setup() {
}
void loop() {
analogWrite(9, pulseWidth);
digitalWrite(6, HIGH); // set the LED on
delay(1000); // wait for a second
analogWrite(9, LOW);
digitalWrite(6, LOW);
delay(100); // wait for a second
analogWrite(6, pulseWidth);
digitalWrite(7, HIGH); // set the LED on
delay(1000); // wait for a second
analogWrite(6, LOW); // set the LED off
digitalWrite(7, LOW); // set the LED off
delay(100);
analogWrite(7, pulseWidth);
digitalWrite(8, HIGH); // set the LED on
delay(1000); // wait for a second
analogWrite(7, LOW); // set the LED off
digitalWrite(8, LOW); // set the LED off
delay(100);
analogWrite(8, pulseWidth);
digitalWrite(9, HIGH); // set the LED on
delay(1000); // wait for a second
analogWrite(8, LOW); // set the LED off
digitalWrite(9, LOW); // set the LED off
delay(100);
}
Blink_2xoutput_PWM.pde (1.15 KB)