Skip to content

Instantly share code, notes, and snippets.

@boxalljohn
Created August 1, 2013 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boxalljohn/6128930 to your computer and use it in GitHub Desktop.
Save boxalljohn/6128930 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();
int y, z;
void setup()
{
// start the matrix at I2C address - default is 0x70
matrix.begin(0x70); // pass in the address
}
void loop()
{
// circles
for (y=0; y<5; y++)
{
for (z=0; z<8; z++)
{
matrix.clear();
matrix.drawCircle(3,3, z, LED_ON);
matrix.writeDisplay(); // write the changes we just made to the display
delay(100);
}
}
for (y=0; y<=5; y++)
{
// rectangles
matrix.clear();
matrix.drawRect(0, 0, 4, 4, LED_ON);
matrix.writeDisplay(); // write the changes we just made to the display
delay(250);
matrix.clear();
matrix.drawRect(4, 0, 4, 4, LED_ON);
matrix.writeDisplay(); // write the changes we just made to the display
delay(250);
matrix.clear();
matrix.fillRect(4, 4, 7, 7, LED_ON);
matrix.writeDisplay(); // write the changes we just made to the display
delay(250);
matrix.clear();
matrix.fillRect(0, 4, 4, 7, LED_ON);
matrix.writeDisplay(); // write the changes we just made to the display
delay(250);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment