-
-
Save mosdragon/8747645 to your computer and use it in GitHub Desktop.
Added RGB color coordination on pins 2,3, and 4, respectively. The lights glow at different intervals, creating combinations of all primary colors to enhance the music experience.
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
int r = 2; | |
int g = 3; | |
int b = 4; | |
void setup() { | |
pinMode(10, OUTPUT); | |
pinMode(r, OUTPUT); | |
pinMode(g, OUTPUT); | |
pinMode(b, OUTPUT); | |
} | |
void loop() { | |
digitalWrite(r, HIGH); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, HIGH); | |
// play e4 | |
delay(600); | |
tone(10, 329.63, 300); | |
delay(350); | |
// play d4# | |
tone(10, 311.13, 300); | |
delay(350); | |
// play e4 | |
tone( 10, 329.63, 300); | |
delay(350); | |
// play d4# | |
tone( 10,311.13, 300); | |
delay(350); | |
digitalWrite(r, HIGH); | |
digitalWrite(g, LOW); | |
digitalWrite(b, LOW); | |
// play e4 | |
tone(10, 329.63, 300); | |
delay(350); | |
// play b3 | |
tone( 10, 246.94, 300); | |
delay(400); | |
// play d4 | |
tone(10, 293.66,300); | |
delay(400); | |
digitalWrite(r, LOW); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, LOW); | |
// play c4 | |
tone(10, 261.63,300); | |
delay(400); | |
// play a3 | |
tone(10, 220, 900); | |
delay(1000); | |
// play d3 | |
tone(10,146.83, 300); | |
delay(350); | |
//play f3 | |
tone(10, 174.61, 300); | |
delay(400); | |
digitalWrite(r, LOW); | |
digitalWrite(g, LOW); | |
digitalWrite(b, HIGH); | |
//play a3 | |
tone(10, 220, 300); | |
delay(400); | |
// play b3 | |
tone(10, 246.94, 900); | |
delay(1000); | |
// play f3 | |
tone(10, 174.61, 300); | |
delay(400); | |
// play a3# | |
tone(10, 233.08, 300); | |
delay(400); | |
// play b3 | |
digitalWrite(r, HIGH); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, HIGH); | |
tone(10, 246.94, 300); | |
delay(400); | |
// play c4 | |
tone(10, 261.63, 900); | |
delay(1000); | |
delay(300); | |
// play e4 | |
tone(10, 329.63, 300); | |
delay(400); | |
// play d4# | |
tone(10, 311.13, 300); | |
delay(400); | |
digitalWrite(r, LOW); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, HIGH); | |
// play e4 | |
tone(10, 329.63, 300); | |
delay(400); | |
// play d4# | |
tone(10, 311.13, 300); | |
delay(400); | |
// play e4 | |
tone(10, 329.63, 300); | |
delay(400); | |
// play b3 | |
tone(10, 246.94, 300); | |
delay(400); | |
// play d4 | |
digitalWrite(r, HIGH); | |
digitalWrite(g, LOW); | |
digitalWrite(b, HIGH); | |
tone(10, 293.66, 300); | |
delay(400); | |
// play c4 | |
tone(10, 261.63, 300); | |
delay(400); | |
// play a3 | |
tone(10, 220, 900); | |
delay(1000); | |
// play d3 | |
tone(10, 146.83, 300); | |
delay(400); | |
// play f3 | |
digitalWrite(r, HIGH); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, LOW); | |
tone(10, 174.61, 300); | |
delay(400); | |
// play a3 | |
tone(10, 220, 300); | |
delay(400); | |
// play b3 | |
tone(10, 246.94, 900); | |
delay(1000); | |
// play f3 | |
tone(10, 174.61, 300); | |
delay(400); | |
digitalWrite(r, HIGH); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, HIGH); | |
// play c4 | |
tone(10, 261.63, 300); | |
delay(400); | |
// play b3 | |
tone(10, 246.94, 300); | |
delay(400); | |
// play a3 | |
tone(10, 220, 900); | |
delay(1000); | |
// play b3 | |
tone(10,246.94, 300); | |
delay(400); | |
digitalWrite(r, HIGH); | |
digitalWrite(g, LOW); | |
digitalWrite(b, LOW); | |
// play c4 | |
tone(10, 261.63, 300); | |
delay(400); | |
// play d4 | |
tone(10, 293.66, 300); | |
delay(400); | |
// play e4 | |
tone(10, 329.63, 900); | |
delay(1000); | |
// play g3 | |
tone(10, 196, 300); | |
delay(400); | |
// play f4 | |
digitalWrite(r, LOW); | |
digitalWrite(g, LOW); | |
digitalWrite(b, HIGH); | |
tone(10, 349.23, 300); | |
delay(400); | |
//play e4 | |
tone(10, 329.23, 300); | |
delay(400); | |
// play d4 | |
tone(10, 293.63, 900); | |
delay(1000); | |
// play e3 | |
tone(10,164.81, 300); | |
delay(400); | |
// play e4 | |
digitalWrite(r, LOW); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, LOW); | |
tone(10, 329.63, 300); | |
delay(400); | |
// play d4 | |
tone(10, 293.63, 300); | |
delay(400); | |
// play c4 | |
tone(10, 261.63, 900); | |
delay(1000); | |
// play d3 | |
tone(10, 146.83, 300); | |
delay(400); | |
// play d4 | |
digitalWrite(r, HIGH); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, HIGH); | |
tone(10, 293.63, 300); | |
delay(400); | |
// play c4 | |
tone(10, 261.63, 300); | |
delay(400); | |
// play b3 | |
tone(10, 246.94, 900); | |
delay(1000); | |
delay(400); | |
// play e4 | |
tone(10, 329.63, 300); | |
delay(400); | |
digitalWrite(r, LOW); | |
digitalWrite(g, LOW); | |
digitalWrite(b, LOW); | |
// play d4# | |
tone(10, 311.13, 300); | |
delay(350); | |
// play e4 | |
tone( 10, 329.63, 300); | |
delay(350); | |
// play d4# | |
tone( 10,311.13, 300); | |
delay(350); | |
// play e4 | |
tone(10, 329.63, 300); | |
delay(350); | |
// play b3 | |
digitalWrite(r, LOW); | |
digitalWrite(g, LOW); | |
digitalWrite(b, HIGH); | |
tone( 10, 246.94, 300); | |
delay(400); | |
// play d4 | |
tone(10, 293.66,300); | |
delay(400); | |
// play c4 | |
tone(10, 261.63,300); | |
delay(400); | |
// play a3 | |
tone(10, 220, 900); | |
delay(1000); | |
// play d3 | |
digitalWrite(r, LOW); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, LOW); | |
tone(10,146.83, 300); | |
delay(350); | |
//play f3 | |
tone(10, 174.61, 300); | |
delay(400); | |
//play a3 | |
tone(10, 220, 300); | |
delay(400); | |
// play b3 | |
tone(10, 246.94, 900); | |
delay(1000); | |
// play f3 | |
digitalWrite(r, HIGH); | |
digitalWrite(g, LOW); | |
digitalWrite(b, LOW); | |
tone(10, 174.61, 300); | |
delay(400); | |
// play a3 | |
tone(10, 233.08, 300); | |
delay(400); | |
// play b3 | |
tone(10, 246.94, 300); | |
delay(400); | |
// play c4 | |
tone(10, 261.63, 900); | |
delay(1000); | |
delay(300); | |
// play e4 | |
digitalWrite(r, HIGH); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, HIGH); | |
tone(10, 329.63, 300); | |
delay(400); | |
// play d4# | |
tone(10, 311.13, 300); | |
delay(400); | |
// play e4 | |
tone(10, 329.63, 300); | |
delay(400); | |
// play d4# | |
tone(10, 311.13, 300); | |
delay(400); | |
// play e4 | |
digitalWrite(r, HIGH); | |
digitalWrite(g, LOW); | |
digitalWrite(b, LOW); | |
tone(10, 329.63, 300); | |
delay(400); | |
// play b3 | |
tone(10, 246.94, 300); | |
delay(400); | |
// play d4 | |
tone(10, 293.66, 300); | |
delay(400); | |
// play c4 | |
tone(10, 261.63, 300); | |
delay(400); | |
// play a3 | |
digitalWrite(r, LOW); | |
digitalWrite(g, LOW); | |
digitalWrite(b, HIGH); | |
tone(10, 220, 900); | |
delay(1000); | |
// play d3 | |
tone(10, 146.83, 300); | |
delay(400); | |
// play f3 | |
tone(10, 174.61, 300); | |
delay(400); | |
// play a3 | |
tone(10, 220, 300); | |
delay(400); | |
// play b3 | |
digitalWrite(r, LOW); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, LOW); | |
tone(10, 246.94, 900); | |
delay(1000); | |
// play f3 | |
tone(10, 174.61, 300); | |
delay(400); | |
// play c4 | |
tone(10, 261.63, 300); | |
delay(400); | |
// play b3 | |
tone(10, 246.94, 300); | |
delay(400); | |
digitalWrite(r, HIGH); | |
digitalWrite(g, HIGH); | |
digitalWrite(b, HIGH); | |
// play a3 | |
tone(10, 220, 900); | |
delay(1000); | |
delay(5000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment