-
-
Save boxalljohn/6128441 to your computer and use it in GitHub Desktop.
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
// required libraries | |
#include <Wire.h> | |
#include "Adafruit_LEDBackpack.h" | |
#include "Adafruit_GFX.h" | |
// define matrix object | |
Adafruit_8x8matrix matrix = Adafruit_8x8matrix(); | |
void setup() | |
{ | |
// start the matrix at I2C address - default is 0x70 | |
matrix.begin(0x70); // pass in the address | |
} | |
void loop() | |
{ | |
matrix.setRotation(0); | |
matrix.setTextSize(1); | |
matrix.setTextWrap(false); // false means nice scroll, true means each character appears, scrolls off, then repeat | |
matrix.setTextColor(LED_ON); | |
for (int8_t x=0; x>=-96; x--) // 96 is number of characters to display x 8 | |
{ | |
matrix.clear(); | |
matrix.setCursor(x,0); | |
matrix.print("Hello, world"); | |
matrix.writeDisplay(); | |
delay(100); | |
} | |
delay(500); | |
matrix.setRotation(1); | |
matrix.setTextSize(1); | |
matrix.setTextWrap(false); // false means nice scroll, true means each character appears, scrolls off, then repeat | |
matrix.setTextColor(LED_ON); | |
for (int8_t x=0; x>=-96; x--) // 96 is number of characters to display x 8 | |
{ | |
matrix.clear(); | |
matrix.setCursor(x,0); | |
matrix.print("Hello, world"); | |
matrix.writeDisplay(); | |
delay(100); | |
} | |
delay(500); | |
matrix.setRotation(2); | |
matrix.setTextSize(1); | |
matrix.setTextWrap(false); // false means nice scroll, true means each character appears, scrolls off, then repeat | |
matrix.setTextColor(LED_ON); | |
for (int8_t x=0; x>=-96; x--) // 96 is number of characters to display x 8 | |
{ | |
matrix.clear(); | |
matrix.setCursor(x,0); | |
matrix.print("Hello, world"); | |
matrix.writeDisplay(); | |
delay(100); | |
} | |
delay(500); | |
matrix.setRotation(3); | |
matrix.setTextSize(1); | |
matrix.setTextWrap(false); // false means nice scroll, true means each character appears, scrolls off, then repeat | |
matrix.setTextColor(LED_ON); | |
for (int8_t x=0; x>=-96; x--) // 96 is number of characters to display x 8 | |
{ | |
matrix.clear(); | |
matrix.setCursor(x,0); | |
matrix.print("Hello, world"); | |
matrix.writeDisplay(); | |
delay(100); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment