Skip to content

Instantly share code, notes, and snippets.

@sledge-1
Created January 25, 2017 20:06
Show Gist options
  • Save sledge-1/6740b0b011c8a68c0e8c076bf0a94c74 to your computer and use it in GitHub Desktop.
Save sledge-1/6740b0b011c8a68c0e8c076bf0a94c74 to your computer and use it in GitHub Desktop.
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 ();
}
@ybakos
Copy link

ybakos commented Jan 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment