//Marquee Party bag by Melissa Felderman for SparkFun Electronics.
// Based on Adafruit_NeoMatrix example for single NeoPixel Shield.
// Scrolls 'PARTY BAG!' across the matrix in a landscape (horizontal) orientation.
#include <Adafruit_GFX.h> //include graphics library
#include <Adafruit_NeoMatrix.h> //include neopixel matrix library
#include <Adafruit_NeoPixel.h> //include neopixel library
#ifndef PSTR
#define PSTR // Make Arduino Due happy
#endif
#define PIN 2
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(8, 8, 6, 1, PIN,
NEO_MATRIX_TOP + NEO_MATRIX_LEFT +
NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE,
NEO_GRB + NEO_KHZ800);
//Inlcude the colors that you would like your writing to reflect in the colors array
const uint16_t colors[] = {
matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255) };
void setup() {
matrix.begin();
matrix.setTextWrap(false);
matrix.setBrightness(40);
matrix.setTextColor(colors[0]);
}
int x = matrix.width();
int pass = 0;
void loop() {
matrix.fillScreen(0);
matrix.setCursor(x, 0);
matrix.print(F("VictorJr")); //replace 'PARTY BAG!' with your personal message
if(--x < -36) {
x = matrix.width();
if(++pass >= 3) pass = 0; //if you included more than three colors in the color array, change the number in the if statement to reflect that amount
matrix.setTextColor(colors[pass]);
}
matrix.show();
delay(100);
}