Last active
December 10, 2015 10:39
-
-
Save cchase88/4422684 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
void setup(){ | |
// Tell the digital pins that we'll be using them for output, not input. | |
pinMode(5, OUTPUT); | |
pinMode(6, OUTPUT); | |
pinMode(7, OUTPUT); | |
pinMode(8, OUTPUT); | |
pinMode(9, OUTPUT); | |
pinMode(10, OUTPUT); | |
pinMode(11, OUTPUT); | |
pinMode(12, OUTPUT); | |
// Set all of the pins we'll be using to LOW (i.e. Off). | |
digitalWrite(5, LOW); | |
digitalWrite(6, LOW); | |
digitalWrite(7, LOW); | |
digitalWrite(8, LOW); | |
digitalWrite(9, LOW); | |
digitalWrite(10, LOW); | |
digitalWrite(11, LOW); | |
digitalWrite(12, LOW); | |
} | |
void loop() { | |
// The letter C: | |
// Representation of the 1st column of our C character: | |
digitalWrite(7, HIGH); | |
digitalWrite(8, HIGH); | |
digitalWrite(9, HIGH); | |
digitalWrite(10, HIGH); | |
delay(100); // Keep the first column on for 100 ms. | |
// Representation of the 2nd column of our C character: | |
digitalWrite(6, HIGH); | |
digitalWrite(7, HIGH); | |
digitalWrite(8, HIGH); | |
digitalWrite(9, HIGH); | |
digitalWrite(10, HIGH); | |
digitalWrite(11, HIGH); | |
delay(100); // Keep the second column on for 100 ms. | |
// Representation of the 3rd column of our C character: | |
digitalWrite(5, HIGH); | |
digitalWrite(6, LOW); // We need to | |
digitalWrite(7, LOW); // turn all of | |
digitalWrite(8, LOW); // the other LEDs | |
digitalWrite(9, LOW); // not being used | |
digitalWrite(10, LOW); // at this time | |
digitalWrite(11, LOW); // to off. | |
digitalWrite(12, HIGH); | |
delay(300) // Keep the third column on for 300 ms. | |
... and the rest of the letters ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment