Skip to content

Instantly share code, notes, and snippets.

@boxalljohn
Created August 1, 2013 04:36
Show Gist options
  • Save boxalljohn/6128441 to your computer and use it in GitHub Desktop.
Save boxalljohn/6128441 to your computer and use it in GitHub Desktop.
// 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