Advertisement
belrey10

Adventure Kit Day_8B

Feb 26th, 2022
11,005
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.78 KB | None | 0 0
  1. // Code written by Kenneth Austin in our comments section
  2. // Learn more at https://inventr.io/adventure
  3.  
  4. int red = 11;
  5. int green = 10;
  6. int blue = 9;
  7.  
  8. void setup() {
  9.   pinMode(red, OUTPUT);
  10.   pinMode(green, OUTPUT);
  11.   pinMode(blue, OUTPUT);
  12. }
  13.  
  14. void loop() {
  15. // put your main code here, to run repeatedly:
  16. RGB_color(125, 255, 255); // Red
  17. delay(1000);
  18. RGB_color(255, 125, 255); // Green
  19. delay(1000);
  20. RGB_color(255, 255, 125); // Blue
  21. delay(1000);
  22. RGB_color(125, 125, 255); // yellow
  23. delay(1000);
  24. RGB_color(125, 255, 125); // purple
  25. delay(1000);
  26. RGB_color(125, 125, 125); // white
  27. delay(1000);
  28. }
  29.  
  30. void RGB_color(int red_value, int green_value, int blue_value)
  31. {
  32.   analogWrite(red, red_value);
  33.   analogWrite(green, green_value);
  34.   analogWrite(blue, blue_value);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement