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
String my_word = "chris"; | |
void loop(){ | |
for(int character = 0; character < my_word.length(); character++){ | |
switch ( my_word.charAt(character) ){ | |
case 'c': | |
c(); | |
break; |
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 c(){ | |
lightUp(B00111100); | |
lightUp(B01111110); | |
lightUp(B10000001); | |
lightUp(B10000001); | |
lightUp(B00000000); | |
} |
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
// lightUp takes a byte | |
void lightUp(byte seq){ | |
// Loop through each of the 8 bits | |
for(int i=0;i<8;i++){ | |
// If the current bit is a 1... | |
if(bitRead(seq, i)){ | |
// turn on that LED by sending HIGH. | |
// The 5 below is the starting pin used on the |
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
c() { | |
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); |
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); |