Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Code written by Kenneth Austin in our comments section
- // Learn more at https://inventr.io/adventure
- int red = 11;
- int green = 10;
- int blue = 9;
- void setup() {
- pinMode(red, OUTPUT);
- pinMode(green, OUTPUT);
- pinMode(blue, OUTPUT);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- RGB_color(125, 255, 255); // Red
- delay(1000);
- RGB_color(255, 125, 255); // Green
- delay(1000);
- RGB_color(255, 255, 125); // Blue
- delay(1000);
- RGB_color(125, 125, 255); // yellow
- delay(1000);
- RGB_color(125, 255, 125); // purple
- delay(1000);
- RGB_color(125, 125, 125); // white
- delay(1000);
- }
- void RGB_color(int red_value, int green_value, int blue_value)
- {
- analogWrite(red, red_value);
- analogWrite(green, green_value);
- analogWrite(blue, blue_value);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement