-
-
Save ybakos/c1a5a56aec985b863f4347342d0c797a to your computer and use it in GitHub Desktop.
This file contains hidden or 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; b = 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