Skip to content

Instantly share code, notes, and snippets.

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