Created
August 1, 2013 06:36
-
-
Save boxalljohn/6128930 to your computer and use it in GitHub Desktop.
This file contains 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(); | |
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