diff options
Diffstat (limited to 'csource/Fade/Fade.cpp')
| -rw-r--r-- | csource/Fade/Fade.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/csource/Fade/Fade.cpp b/csource/Fade/Fade.cpp index ffc7636..0c5a2a1 100644 --- a/csource/Fade/Fade.cpp +++ b/csource/Fade/Fade.cpp @@ -16,12 +16,14 @@ int fadeAmount = 5; // how many points to fade the LED by void setup() { // declare pin 9 to be an output: - pinMode(GREEN_LED, OUTPUT); + pinMode(GREEN_LED, OUTPUT); + pinMode(RED_LED, OUTPUT); } void loop() { // set the brightness of pin 9: - analogWrite(GREEN_LED, brightness); + analogWrite(GREEN_LED, brightness); + analogWrite(RED_LED, 255-brightness); // change the brightness for next time through the loop: brightness = brightness + fadeAmount; |
