#define DATA_PIN 2
#define CLOCK_PIN 3
#define LATCH_PIN 4
byte character[27][8] =
{
{ B00011000,B00111100,B01100110,B01100110,B01111110,B01100110,B01100110,B00000000 }, //A
{ B11111100,B01100110,B01100110,B01111100,B01100110,B01100110,B11111100,B00000000 }, //B
{ B00111100,B01100110,B01000000,B01000000,B01000000,B01100110,B00111100,B00000000 }, //C
{ B11111000,B01101100,B01100110,B01100110,B01100110,B01101100,B11111000,B00000000 }, //D
{ B11111110,B01100010,B01101000,B01111000,B01101000,B01100010,B11111110,B00000000 }, //E
{ B11111110,B01100010,B01101000,B01111000,B01101000,B01100000,B11110000,B00000000 }, //F
{ B00111100,B01100110,B11000000,B11000000,B11001110,B01100110,B00111110,B00000000 }, //G
{ B11001100,B11001100,B11001100,B11111100,B11001100,B11001100,B11001100,B00000000 }, //H
{ B01111000,B00110000,B00110000,B00110000,B00110000,B00110000,B01111000,B00000000 }, //I
{ B00011110,B00001100,B00001100,B00001100,B11001100,B11001100,B01111000,B00000000 }, //J
{ B11110110,B01100110,B01101100,B01111000,B01101100,B01100110,B11110110,B00000000 }, //K
{ B11110000,B01100000,B01100000,B01100000,B01100010,B01100110,B11111110,B00000000 }, //L
{ B11000110,B11101110,B11111110,B11111110,B11010110,B11000110,B11000110,B00000000 }, //M
{ B11000110,B11100110,B11110110,B11011110,B11001110,B11000110,B11000110,B00000000 }, //N
{ B00111000,B01101100,B11000110,B11000110,B11000110,B01101100,B00111000,B00000000 }, //O
{ B11111100,B01100110,B01100110,B01111100,B01100000,B01100000,B11110000,B00000000 }, //P
{ B01111000,B11001100,B11001100,B11001100,B11011100,B01111000,B00011100,B00000000 }, //Q
{ B11111100,B01100110,B01100110,B01111100,B01101100,B01100110,B11110110,B00000000 }, //R
{ B01111000,B11001100,B11100000,B01110000,B00011100,B11001100,B01111000,B00000000 }, //S
{ B11111100,B10110100,B00110000,B00110000,B00110000,B00110000,B01111000,B00000000 }, //T
{ B11001100,B11001100,B11001100,B11001100,B11001100,B11001100,B11111100,B00000000 }, //U
{ B11001100,B11001100,B11001100,B11001100,B11001100,B01111000,B00110000,B00000000 }, //V
{ B11000110,B11000110,B11000110,B11010110,B11111110,B11101110,B11000110,B00000000 }, //W
{ B11000110,B11000110,B01101100,B00111000,B00111000,B01101100,B11000110,B00000000 }, //X
{ B11001100,B11001100,B11001100,B01111000,B00110000,B00110000,B01111000,B00000000 }, //Y
{ B11111110,B11000110,B10001100,B00011000,B00110010,B01100110,B11111110,B00000000 }, //Z
{ B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000 } //(blank)
};
int charN = 0;
unsigned long lastCharUpdate = 0;
void setup()
{
pinMode(DATA_PIN, OUTPUT);
pinMode(CLOCK_PIN, OUTPUT);
pinMode(LATCH_PIN, OUTPUT);
}
void loop()
{
if (millis() - lastCharUpdate >= 500)
{
charN = (charN + 1) % 27;
lastCharUpdate = millis();
}
for (int i = 0; i < 8; i++)
{
shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, 0x01 << i);
shiftOut(DATA_PIN, CLOCK_PIN, LSBFIRST, 0xff ^ character[charN][i]);
digitalWrite(LATCH_PIN, HIGH);
digitalWrite(LATCH_PIN, LOW);
delay(5);
}
}