Hello everyone i just made a simple code that displays the letter A on my matrix but its really inconvenient cause if i wanted to spell out a word it would take a long time to make the code. Is there a way to make an integer called A and i can just say shiftout A in the code or type a in the serial command box?
Basically what im asking is can i put everything thats in the loop of this code and make it an integer and then just say shiftout A and it will work or is there a way to make like a 1's and 0's box to tell what to put on the registers like this
11111
10001
11111
10001 this on the left would be the A. is there a way to do this in the code?
10001
heres the code
/*
Led matrix using two 595 shift registers
one for columns and one for rows
comluns are positive and rows are negative
but have transistors on them
im modifying an example code found on arduino website
By:Chris Yambo
*/
const int CPR = 2;
// clock pin row
const int LPR = 3;
// latch pin row
const int DPR = 4;
// data pin row
const int CPC = 8;
// clock pin cloumn
const int LPC = 9;
// latch pin column
const int DPC = 10;
// data pin column
void setup() {
//set pins to output because they are addressed in the main loop
pinMode(CPR, OUTPUT);
pinMode(LPR, OUTPUT);
pinMode(DPR, OUTPUT);
pinMode(CPC, OUTPUT);
pinMode(LPC, OUTPUT);
pinMode(DPC, OUTPUT);
}
void loop() {
// turn off the output so the pins don't light up
// while you're shifting bits:
digitalWrite(LPR, LOW);
digitalWrite(LPC, LOW);
shiftOut(DPR, CPR, LSBFIRST, 128);
shiftOut(DPC, CPC, LSBFIRST, 136);
// turn on the output so the LEDs can light up:
digitalWrite(LPR, HIGH);
digitalWrite(LPC, HIGH);
digitalWrite(LPR, LOW);
digitalWrite(LPC, LOW);
shiftOut(DPR, CPR, LSBFIRST, 64);
shiftOut(DPC, CPC, LSBFIRST, 136);
// turn on the output so the LEDs can light up:
digitalWrite(LPR, HIGH);
digitalWrite(LPC, HIGH);
digitalWrite(LPR, LOW);
digitalWrite(LPC, LOW);
shiftOut(DPR, CPR, LSBFIRST, 32);
shiftOut(DPC, CPC, LSBFIRST, 255);
// turn on the output so the LEDs can light up:
digitalWrite(LPR, HIGH);
digitalWrite(LPC, HIGH);
digitalWrite(LPR, LOW);
digitalWrite(LPC, LOW);
shiftOut(DPR, CPR, LSBFIRST, 16);
shiftOut(DPC, CPC, LSBFIRST, 136);
// turn on the output so the LEDs can light up:
digitalWrite(LPR, HIGH);
digitalWrite(LPC, HIGH);
digitalWrite(LPR, LOW);
digitalWrite(LPC, LOW);
shiftOut(DPR, CPR, LSBFIRST, 8); // this is an 8 not a smiley face idk why its doing that
shiftOut(DPC, CPC, LSBFIRST, 255);
// turn on the output so the LEDs can light up:
digitalWrite(LPR, HIGH);
digitalWrite(LPC, HIGH);
}