Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Derived from Adafruit RGB_matrix_Panel library */
- #include <SPI.h>
- #include <Adafruit_GFX.h> // Core graphics library
- #include <P3RGB64x32MatrixPanel.h>
- // constructor with default pin wiring
- P3RGB64x32MatrixPanel matrix;
- // use this constructor for custom pin wiring instead of the default above
- // these pins are an example, you may modify this according to your needs
- //P3RGB64x32MatrixPanel matrix(25, 26, 27, 21, 22, 23, 15, 32, 33, 12, 16, 17, 18);
- uint16_t Wheel(byte WheelPos)
- {
- if (WheelPos < 8)
- {
- return matrix.color444(15 - WheelPos * 2, WheelPos * 2, 0);
- }
- else if (WheelPos < 16)
- {
- WheelPos -= 8;
- return matrix.color444(0, 15 - WheelPos * 2, WheelPos * 2);
- }
- else
- {
- WheelPos -= 16;
- return matrix.color444(0, WheelPos * 2, 7 - WheelPos * 2);
- }
- }
- void setup()
- {
- matrix.begin();
- // whew!
- }
- void loop()
- {
- // do nothing
- for (int i = 0; i < matrix.height(); i++)
- {
- matrix.drawLine(0,i,64,i,matrix.color444(i,15,15));
- delay(100);
- }
- matrix.fillRect(0, 0, matrix.width(), matrix.height(), matrix.color444(0, 0, 0));
- }
- // Input a value 0 to 24 to get a color value.
- // The colours are a transition r - g - b - back to r.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement