Created
September 25, 2016 00:53
-
-
Save anonymous/c8c387144be60af2cf3f3f96d2dd479b to your computer and use it in GitHub Desktop.
Small Airship Test Code
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
#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