Created
January 25, 2017 20:06
-
-
Save sledge-1/6740b0b011c8a68c0e8c076bf0a94c74 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
const int LED[] = {9,10,11}; | |
void setPinAndBrightnessUp (){ | |
for (double b = 2; b < 256; pow(b,1.15) ){ | |
for (int a = 0; a < 2; a++){ | |
analogWrite(LED[a],(int)b); | |
delay(20); | |
analogWrite(LED[a], 0); | |
delay(10); | |
} | |
} | |
} | |
void setPinAndBrightnessDown (){ | |
for (int b = 255; b > 1; b-=5){ | |
for (int a = 1; a >= 0; a--){ | |
analogWrite(LED[a],b); | |
delay(20); | |
analogWrite(LED[a], 0); | |
delay(10); | |
} | |
} | |
} | |
void setup() { | |
pinMode( 9 , OUTPUT); | |
pinMode( 10 , OUTPUT); | |
pinMode( 11 , OUTPUT); | |
} | |
void loop() { | |
setPinAndBrightnessUp(); | |
setPinAndBrightnessDown (); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see now. Take a look at the diff here:
https://gist.github.com/ybakos/c1a5a56aec985b863f4347342d0c797a/revisions