Skip to content

Instantly share code, notes, and snippets.

View gist:4438717
String my_word = "chris";
void loop(){
for(int character = 0; character < my_word.length(); character++){
switch ( my_word.charAt(character) ){
case 'c':
c();
break;
View gist:4438588
void c(){
lightUp(B00111100);
lightUp(B01111110);
lightUp(B10000001);
lightUp(B10000001);
lightUp(B00000000);
}
View gist:4436267
// 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
View gist:4423053
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);
View gist:4422684
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);