Skip to content

Instantly share code, notes, and snippets.

@ryanmr

ryanmr/grid.c

Created Apr 18, 2014
Embed
What would you like to do?
/*
Use ifupdown.com/putnam/generator.html
to generate a matrix and global values.
Then paste that generated code here.
*/
void loop() {
int WIDTH = (LETTERS - 1) * RANGE;
int position = 0;
for (position = 0; position < WIDTH; position++) {
int refresh = 0;
for (refresh = 0; refresh < REFRESH_END; refresh++) {
for (int letter = 0; letter < LETTERS; letter++) {
int a = 0, b = 0;
for (a = 2; a < 11; a++) {
digitalWrite(a, LOW);
}
for (b = BASE_PIN; b < (BASE_PIN + RANGE); b++) {
digitalWrite(b, HIGH);
}
digitalWrite(2 + letter, HIGH);
for (int i = 0; i < RANGE; i++) {
int p = (letter * RANGE) + i;
if ( matrix[p] != 0 ) {
digitalWrite(BASE_PIN + write_out, LOW);
}
write_out++;
}
delay(1);
digitalWrite(2 + letter, LOW);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment