This file contains hidden or 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
| //Swoop 1, direction 1 | |
| if (ypos1 > 6){ | |
| //draw two pixels | |
| matrix.drawPixel(xpos1, ypos1, matrix.Color888(0, 255, 0)); | |
| matrix.drawPixel(xpos2, ypos2, matrix.Color888(0, 255, 0)); | |
| delay(64); | |
| //increment x and y positions of each pixel | |
| xpos1++; | |
| xpos2++; | |
| ypos1 = ypos1 - 2; |
This file contains hidden or 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
| // Streak 1 | |
| if(y1 != YOFFBOARD && shouldFade == 0){ | |
| // start from top, move down | |
| matrix.drawPixel(6, y1, matrix.Color888(204, 255, 229)); | |
| // wait one frame | |
| delay(FRAME); | |
| // reset that current pixel | |
| matrix.drawPixel(6, y1, matrix.Color888(0, 0, 0)); | |
| // increment y to go up 1 (down board) | |
| y1++; |
This file contains hidden or 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
| //This is just a portion of the reset function because there were so many variables. But you get the gist. | |
| void reset(){ | |
| for (int x=0; x < 32; x++) { | |
| for (int y=0; y < 16; y++) { | |
| matrix.drawPixel(x,y, matrix.Color888(0, 0, 0)); | |
| } | |
| } | |
| shouldFade = 1; | |
| //Streak Variables | |
| y1 = Y1MIN; |
This file contains hidden or 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
| #include <Adafruit_GFX.h> // Core graphics library | |
| #include <RGBmatrixPanel.h> // Hardware-specific library | |
| //These initialize the pins on the Arduino to control the LED board | |
| #define CLK 8 // MUST be on PORTB! (Use pin 11 on Mega) | |
| #define LAT A3 | |
| #define OE 9 | |
| #define A A0 | |
| #define B A1 | |
| #define C A2 |