Created
May 10, 2017 17:45
-
-
Save anonymous/d4fa3719478c3c5a9c321cc372e95407 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Code created by Ian Buckley for an article on makeuseof.com | |
//define pins for the red, green and blue LEDs | |
#define RED_LED 6 | |
#define BLUE_LED 5 | |
#define GREEN_LED 9 | |
//overall brightness value | |
int brightness = 255; | |
//individual brightness values for the red, green and blue LEDs | |
int gBright = 0; | |
int rBright = 0; | |
int bBright = 0; | |
int fadeSpeed = 10; | |
void setup() { | |
//set up pins to output. | |
pinMode(GREEN_LED, OUTPUT); | |
pinMode(RED_LED, OUTPUT); | |
pinMode(BLUE_LED, OUTPUT); | |
//Call the TurnOn method, wait, then call TurnOff | |
TurnOn(); | |
delay(5000); | |
TurnOff(); | |
} | |
void TurnOn(){ | |
for (int i=0;i<256; i++){ | |
analogWrite(RED_LED, rBright); | |
rBright +=1; | |
delay(fadeSpeed); | |
} | |
for (int i=0;i<256; i++){ | |
analogWrite(BLUE_LED, bBright); | |
bBright += 1; | |
delay(fadeSpeed); | |
} | |
for (int i=0;i<256; i++){ | |
analogWrite(GREEN_LED, gBright); | |
gBright +=1; | |
delay(fadeSpeed); | |
} | |
} | |
void TurnOff(){ | |
for (int i=0;i<256; i++){ | |
analogWrite(GREEN_LED, brightness); | |
analogWrite(RED_LED, brightness); | |
analogWrite(BLUE_LED, brightness); | |
brightness -= 1; | |
delay(delay(fadeSpeed); | |
} | |
} | |
void loop(){ | |
} | |
Line 67 should read: delay(fadeSpeed);
Zeile 17 wird Fehler angezeigt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
does not work, error line 67