Skip to content

Instantly share code, notes, and snippets.

@smarthall
Created May 17, 2012 04:06
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 smarthall/2716231 to your computer and use it in GitHub Desktop.
Save smarthall/2716231 to your computer and use it in GitHub Desktop.
PhotoMapDisplay
//We always have to include the library
#include "LedControl.h"
LedControl lc=LedControl(10,11,12,1);
unsigned long delaytime=100;
void setup() {
Serial.begin(9600);
Serial.print("Booting...");
lc.shutdown(0,false);
/* Set the brightness to a medium values */
lc.setIntensity(0,8);
/* and clear the display */
lc.clearDisplay(0);
for(int row=0;row<8;row++) {
for(int col=0;col<8;col++) {
delay(50);
lc.setLed(0,row,col,false);
}
}
Serial.println(" Done!");
}
void single() {
int row = random(0,2);
int col = random(0,8);
int on = random(0,2);
delay(50);
lc.setLed(0,row,col,on);
}
void loop() {
single();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment