Created
January 22, 2014 03:48
-
-
Save dwhacks/8553207 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
int redPin = 1; | |
int greenPin = 4; | |
int bluePin = 0; | |
void setup() | |
{ | |
pinMode(redPin, OUTPUT); | |
pinMode(greenPin, OUTPUT); | |
pinMode(bluePin, OUTPUT); | |
} | |
void loop() | |
{ | |
setColor(255, 0, 0); // red | |
delay(3000); | |
setColor(0, 255, 0); // green | |
delay(3000); | |
setColor(0, 0, 255); // blue | |
delay(3000); | |
setColor(255, 255, 0); // yellow | |
delay(3000); | |
setColor(80, 0, 80); // purple | |
delay(3000); | |
setColor(0, 255, 255); // aqua | |
delay(3000); | |
setColor(0xFF, 0xA5, 0x0); // orange | |
delay(3000); | |
setColor(0xFF, 0x0, 0xFF); // pink | |
delay(3000); | |
setColor(0xDA, 0xA5, 0x20); // gold | |
delay(3000); | |
} | |
void setColor(int red, int green, int blue) | |
{ | |
analogWrite(redPin, red); | |
analogWrite(greenPin, green); | |
analogWrite(bluePin, blue); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment