Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. /* Derived from Adafruit RGB_matrix_Panel library */
  2. #include <SPI.h>
  3. #include <Adafruit_GFX.h> // Core graphics library
  4. #include <P3RGB64x32MatrixPanel.h>
  5.  
  6. // constructor with default pin wiring
  7. P3RGB64x32MatrixPanel matrix;
  8.  
  9. // use this constructor for custom pin wiring instead of the default above
  10. // these pins are an example, you may modify this according to your needs
  11. //P3RGB64x32MatrixPanel matrix(25, 26, 27, 21, 22, 23, 15, 32, 33, 12, 16, 17, 18);
  12. uint16_t Wheel(byte WheelPos)
  13. {
  14. if (WheelPos < 8)
  15. {
  16. return matrix.color444(15 - WheelPos * 2, WheelPos * 2, 0);
  17. }
  18. else if (WheelPos < 16)
  19. {
  20. WheelPos -= 8;
  21. return matrix.color444(0, 15 - WheelPos * 2, WheelPos * 2);
  22. }
  23. else
  24. {
  25. WheelPos -= 16;
  26. return matrix.color444(0, WheelPos * 2, 7 - WheelPos * 2);
  27. }
  28. }
  29.  
  30. void setup()
  31. {
  32.  
  33. matrix.begin();
  34. // whew!
  35. }
  36.  
  37. void loop()
  38. {
  39. // do nothing
  40. for (int i = 0; i < matrix.height(); i++)
  41. {
  42. matrix.drawLine(0,i,64,i,matrix.color444(i,15,15));
  43. delay(100);
  44. }
  45. matrix.fillRect(0, 0, matrix.width(), matrix.height(), matrix.color444(0, 0, 0));
  46. }
  47.  
  48. // Input a value 0 to 24 to get a color value.
  49. // The colours are a transition r - g - b - back to r.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement