Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Created September 25, 2016 00:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c8c387144be60af2cf3f3f96d2dd479b to your computer and use it in GitHub Desktop.
Save anonymous/c8c387144be60af2cf3f3f96d2dd479b to your computer and use it in GitHub Desktop.
Small Airship Test Code
#define LED_LATCH 7
#define LED_CLOCK 8
#define LED_DATA 9
byte matrix[64] {
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //1
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //2
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //4
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //6
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //8
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //7
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //5
HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, //3
};
void setup() {
pinMode(LED_LATCH,OUTPUT);
pinMode(LED_CLOCK,OUTPUT);
pinMode(LED_DATA,OUTPUT);
digitalWrite(LED_LATCH,LOW);
digitalWrite(LED_CLOCK,LOW);
digitalWrite(LED_DATA,LOW);
}
void loop() {
for (byte v=0; v<8; v++){
delayMicroseconds(10);
for (byte h=0; h<8; h++){
digitalWrite(LED_DATA,matrix[(v*8)+h]);
digitalWrite(LED_LATCH,HIGH);
delayMicroseconds(1);
digitalWrite(LED_LATCH,LOW);
delayMicroseconds(1);
}
}
digitalWrite(LED_CLOCK,HIGH);
delayMicroseconds(1);
digitalWrite(LED_CLOCK,LOW);
delayMicroseconds(200);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment