Has anyone any idea where I’m going wrong. I’m new to all this but have followed a tutorial on making a 48x8 matrix. I have finished the project and it switches on but non of the letters are appearing as they should. It scrolls right to left. I have checked all connections and PIN numbers. Any further info please ask. I know I’ve been vague.
Fix that first.
That is all the real information you have told us. No wiring diagram, no software, no photographs where we can actually see the wiring. Please give us a break
Preformatted text
Fair point.
Using a arduino uno. Followed the attached diagram and double checked all connections and outputs and inputs. Using a 12v dc power supply with voltage regulators.
Using the following code I got from the same tutorial page
Thanks for you patience
Preformatted text
#define max_char 100
int charIndex;
int scrollspeed = 7; //Set the scroll speed ( lower=faster)
int i;
int x;
int y;
char r_char;
char msg[] =" Kyot-Kyot ";//Change the text here.
//Columns
int clockPin1 = 3; //Arduino pin connected to Clock Pin 11 of 74HC595
int latchPin1 = 2; //Arduino pin connected to Latch Pin 12 of 74HC595
int dataPin1 = 4; //Arduino pin connected to Data Pin 14 of 74HC595
//Rows
int clockPin2 = 7; //Arduino pin connected to Clock Pin 11 of 74HC595
int latchPin2 = 6; //Arduino pin connected to Latch Pin 12 of 74HC595
int dataPin2 = 5; //Arduino pin connected to Data Pin 14 of 74HC595
//BITMAP
//Bits in this array represents one LED of the matrix
// 8 is # of rows, 6 is # of LED matrices
byte bitmap[8][7];
int numZones = sizeof(bitmap) / 8; // One Zone refers to one 8 x 8 Matrix ( Group of 8 columns)
int maxZoneIndex = numZones-1;
int numCols = numZones * 8;
char alphabets[][8] = {
{0x00,0x00,0x00,0x00,0x00,0x00}, // SPACE
{0x00,0x00,0x00,0x5F,0x00,0x00}, // !
{0x00,0x00,0x07,0x00,0x07,0x00}, // "
{0x00,0x14,0x7F,0x14,0x7F,0x14}, // #
{0x00,0x24,0x2A,0x7F,0x2A,0x12}, // $
{0x00,0x23,0x13,0x08,0x64,0x62}, // %
{0x00,0x36,0x49,0x55,0x22,0x50}, // &
{0x00,0x00,0x05,0x03,0x00,0x00}, // '
{0x00,0x00,0x1C,0x22,0x41,0x00}, // (
{0x00,0x00,0x41,0x22,0x1C,0x00}, // )
{0x00,0x14,0x08,0x3E,0x08,0x14}, // *
{0x00,0x08,0x08,0x3E,0x08,0x08}, // +
{0x00,0x00,0x50,0x30,0x00,0x00}, // ,
{0x00,0x08,0x08,0x08,0x08,0x08}, // -
{0x00,0x00,0x60,0x60,0x00,0x00}, // .
{0x00,0x20,0x10,0x08,0x04,0x02}, // /
{0x00,0x3E,0x51,0x49,0x45,0x3E}, // 0
{0x00,0x00,0x42,0x7F,0x40,0x00}, // 1
{0x00,0x42,0x61,0x51,0x49,0x46}, // 2
{0x00,0x21,0x41,0x45,0x4B,0x31}, // 3
{0x00,0x18,0x14,0x12,0x7F,0x10}, // 4
{0x00,0x27,0x45,0x45,0x45,0x39}, // 5
{0x00,0x3C,0x4A,0x49,0x49,0x30}, // 6
{0x00,0x01,0x71,0x09,0x05,0x03}, // 7
{0x00,0x36,0x49,0x49,0x49,0x36}, // 8
{0x00,0x06,0x49,0x49,0x29,0x1E}, // 9
{0x00,0x36,0x36,0x00,0x00,0x00}, // :
{0x00,0x56,0x36,0x00,0x00,0x00}, // ;
{0x00,0x08,0x14,0x22,0x41,0x00}, // <
{0x00,0x14,0x14,0x14,0x14,0x14}, // =
{0x00,0x00,0x41,0x22,0x14,0x08}, // >
{0x00,0x02,0x01,0x51,0x09,0x06}, // ?
{0x00,0x30,0x49,0x79,0x41,0x3E}, // @
{0x00,0x7E,0x11,0x11,0x11,0x7E}, // A
{0x00,0x7F,0x49,0x49,0x49,0x36}, // B
{0x00,0x3E,0x41,0x41,0x41,0x22}, // C
{0x00,0x7F,0x41,0x41,0x22,0x1C}, // D
{0x00,0x7F,0x49,0x49,0x49,0x41}, // E
{0x00,0x7F,0x09,0x09,0x09,0x01}, // F
{0x00,0x3E,0x41,0x49,0x49,0x7A}, // G
{0x00,0x7F,0x08,0x08,0x08,0x7F}, // H
{0x00,0x00,0x41,0x7F,0x41,0x00}, // I
{0x00,0x20,0x40,0x41,0x3F,0x01}, // J
{0x00,0x7F,0x08,0x14,0x22,0x41}, // K
{0x00,0x7F,0x40,0x40,0x40,0x40}, // L
{0x00,0x7F,0x02,0x0C,0x02,0x7F}, // M
{0x00,0x7F,0x04,0x08,0x10,0x7F}, // N
{0x00,0x3E,0x41,0x41,0x41,0x3E}, // O
{0x00,0x7F,0x09,0x09,0x09,0x06}, // P
{0x00,0x3E,0x41,0x51,0x21,0x5E}, // Q
{0x00,0x7F,0x09,0x19,0x29,0x46}, // R
{0x00,0x46,0x49,0x49,0x49,0x31}, // S
{0x00,0x01,0x01,0x7F,0x01,0x01}, // T
{0x00,0x3F,0x40,0x40,0x40,0x3F}, // U
{0x00,0x1F,0x20,0x40,0x20,0x1F}, // V
{0x00,0x3F,0x40,0x30,0x40,0x3F}, // W
{0x00,0x63,0x14,0x08,0x14,0x63}, // X
{0x00,0x07,0x08,0x70,0x08,0x07}, // Y
{0x00,0x61,0x51,0x49,0x45,0x43}, // Z
{0x00,0x00,0x7F,0x41,0x41,0x00}, // [
{0x00,0x02,0x04,0x08,0x10,0x20}, // backslash
{0x00,0x00,0x41,0x41,0x7F,0x00}, // ]
{0x00,0x04,0x02,0x01,0x02,0x04}, // ^
{0x00,0x40,0x40,0x40,0x40,0x40}, // _
{0x00,0x00,0x01,0x02,0x04,0x00}, // `
{0x00,0x20,0x54,0x54,0x54,0x78}, // a
{0x00,0x7F,0x50,0x48,0x48,0x30}, // b
{0x00,0x38,0x44,0x44,0x44,0x28}, // c
{0x00,0x38,0x44,0x44,0x48,0x7F}, // d
{0x00,0x38,0x54,0x54,0x54,0x18}, // e
{0x00,0x08,0x7E,0x09,0x01,0x02}, // f
{0x00,0x0C,0x52,0x52,0x52,0x3E}, // g
{0x00,0x7F,0x08,0x04,0x04,0x78}, // h
{0x00,0x00,0x44,0x7D,0x40,0x00}, // i
{0x00,0x20,0x40,0x44,0x3D,0x00}, // j
{0x00,0x7F,0x10,0x28,0x44,0x00}, // k
{0x00,0x00,0x41,0x7F,0x40,0x00}, // l
{0x00,0x78,0x04,0x18,0x04,0x78}, // m
{0x00,0x7C,0x08,0x04,0x04,0x78}, // n
{0x00,0x38,0x44,0x44,0x44,0x38}, // o
{0x00,0x7C,0x14,0x14,0x14,0x08}, // p
{0x00,0x08,0x14,0x14,0x18,0xFC}, // q
{0x00,0x7C,0x08,0x04,0x04,0x08}, // r
{0x00,0x48,0x54,0x54,0x54,0x20}, // s
{0x00,0x04,0x3F,0x44,0x40,0x20}, // t
{0x00,0x3C,0x40,0x40,0x20,0x7C}, // u
{0x00,0x1C,0x20,0x40,0x20,0x1C}, // v
{0x00,0x3C,0x40,0x30,0x40,0x3C}, // w
{0x00,0x44,0x28,0x10,0x28,0x44}, // x
{0x00,0x0C,0x50,0x50,0x50,0x3C}, // y
{0x00,0x44,0x64,0x54,0x4C,0x44}, // z
{0x00,0x00,0x08,0x36,0x41,0x00}, // {
};
void clearBitmap()
{
//Clear bitmap
for (int row = 0; row < 8; row++) {
for (int zone = 0; zone <= maxZoneIndex; zone++) {
bitmap[row][zone] = 0;
}
}
}
void setup() {
pinMode(latchPin1, OUTPUT);
pinMode(clockPin1, OUTPUT);
pinMode(dataPin1, OUTPUT);
pinMode(latchPin2, OUTPUT);
pinMode(clockPin2, OUTPUT);
pinMode(dataPin2, OUTPUT);
Serial.begin(9600);
clearBitmap();
}
//FUNCTIONS
// Displays bitmap array in the matrix
void RefreshDisplay() {
for (int row = 0; row < 8; row++) {
int rowbit = 1 << row;
digitalWrite(latchPin2, LOW);//Hold latchPin LOW for transmitting data
shiftOut(dataPin2, clockPin2, LSBFIRST, rowbit); //Transmit data
//Start sending column bytes
digitalWrite(latchPin1, LOW);//Hold latchPin LOW for transmitting data
//Shift out to each matrix
for (int zone = maxZoneIndex; zone >= 0; zone--)
{
shiftOut(dataPin1, clockPin1, MSBFIRST, bitmap[row][zone]);
}
//flip both latches at once to eliminate flicker
digitalWrite(latchPin1, HIGH);//Return the latch pin 1 high to signal chip
digitalWrite(latchPin2, HIGH);//Return the latch pin 2 high to signal chip
//Wait
delayMicroseconds(300);
}
}
// Converts row and colum to bitmap bit and turn it off/on
void Plot(int col, int row, bool isOn) {
int zone = col / 8;
int colBitIndex = x % 8;
byte colBit = 1 << colBitIndex;
if (isOn)
bitmap[row][zone] = bitmap[y][zone] | colBit;
else
bitmap[row][zone] = bitmap[y][zone] & (~colBit);
}
// Plot each character of the message one column at a time, updated the display, shift bitmap left.
void XProcess() {
for (charIndex=0; charIndex <(sizeof(msg)-1); charIndex++)
{
int alphabetIndex = msg[charIndex] - ' '; // I changed '@' to ' ' to display the different alphabets
if (alphabetIndex < 0) alphabetIndex=0;
//Draw one character of the message
// Each character is 5 columns wide, loop two more times to create 2 pixel space betwen characters
for (int col = 0; col < 8; col++)
{
for (int row = 0; row < 8; row++)
{
// Set the pixel to what the alphabet say for columns 0 thru 4, but always leave columns 5 and 6 blank.
bool isOn = 0;
if (col<8) isOn = bitRead( alphabets[alphabetIndex][col], 7-row ) == 1;
Plot( numCols-1, row, isOn); //Draw on the rightmost column, the shift loop below will scroll it leftward.
}
for (int refreshCount=0; refreshCount < scrollspeed; refreshCount++)
RefreshDisplay();
//Shift the bitmap one column to left
for (int row=0; row<8; row++)
{
for (int zone=0; zone < numZones; zone++)
{
//This right shift would show as a left scroll on display because leftmost column is represented by least significant bit of the byte.
bitmap[row][zone] = bitmap[row][zone] >> 1;
// Shift over lowest bit from the next zone as highest bit of this zone.
if (zone < maxZoneIndex) bitWrite(bitmap[row][zone], 7, bitRead(bitmap[row][zone+1],0));
}
}
}
}
}
void serialInput() {
//check if serial is avaible an before reading a new message delete's the old message
if(Serial.available()){
for(i=0; i<105; i++){
msg[i] = '\0';
}
//resests the index
charIndex=0;
}
//while is reading the message
while(Serial.available()){
//the message can have up to 100 characters
if(charIndex < (max_char-1))
{
r_char = Serial.read(); // Reads a character
msg[charIndex] = r_char; // Stores the character in message array
charIndex++; // Increment position
msg[charIndex] = '\0'; // Delete the last position
}
}
}
void loop() {
XProcess();
serialInput();
}
Preformatted text
Needs less "vague", and more code tags
Oops
Whoah, whoah!
Go read the instructions for posting so you can modify (using the "pencil" icon underneath) your posting!
Hi
Please read : " How to get the best out of this forum "
and redo your post putting the code between the </> tags.
Missing +5V at U9.
`char msg[] ="HELLO";//t here.
int scrollspeed=10;//Set the scroll speed ( lower=faster)
int x;
int y;
//Columns
int clockPin1 = 3; //Arduino pin connected to Clock Pin 11 of 74HC595
int latchPin1 = 2; //Arduino pin connected to Latch Pin 12 of 74HC595
int dataPin1 = 4; //Arduino pin connected to Data Pin 14 of 74HC595
//Rows
int clockPin2 = 6; //Arduino pin connected to Clock Pin 11 of 74HC595
int latchPin2 = 7; //Arduino pin connected to Latch Pin 12 of 74HC595
int dataPin2 = 5; //Arduino pin connected to Data Pin 14 of 74HC595
//BITMAP
//Bits in this array represents one LED of the matrix
// 8 is # of rows, 6 is # of LED matrices
byte bitmap[8][7];
int numZones = sizeof(bitmap) / 8; // One Zone refers to one 8 x 8 Matrix ( Group of 8 columns)
int maxZoneIndex = numZones-1;
int numCols = numZones * 8;
//FONT DEFENITION
byte alphabets[][8] = {
{0,0,0,0,0},//@ as SPACE
//{8,28,54,99,65},//<<
{31, 36, 68, 36, 31},//A
{127, 73, 73, 73, 54},//B
{62, 65, 65, 65, 34},//C
{127, 65, 65, 34, 28},//D
{127, 73, 73, 65, 65},//E
{127, 72, 72, 72, 64},//F
{62, 65, 65, 69, 38},//G
{127, 8, 8, 8, 127},//H
{0, 65, 127, 65, 0},//I
{2, 1, 1, 1, 126},//J
{127, 8, 20, 34, 65},//K
{127, 1, 1, 1, 1},//L
{127, 32, 16, 32, 127},//M
{127, 32, 16, 8, 127},//N
{62, 65, 65, 65, 62},//O
{127, 72, 72, 72, 48},//P
{62, 65, 69, 66, 61},//Q
{127, 72, 76, 74, 49},//R
{50, 73, 73, 73, 38},//S
{64, 64, 127, 64, 64},//T
{126, 1, 1, 1, 126},//U
{124, 2, 1, 2, 124},//V
{126, 1, 6, 1, 126},//W
{99, 20, 8, 20, 99},//X
{96, 16, 15, 16, 96},//Y
{67, 69, 73, 81, 97},//Z
};
void setup() {
pinMode(latchPin1, OUTPUT);
pinMode(clockPin1, OUTPUT);
pinMode(dataPin1, OUTPUT);
pinMode(latchPin2, OUTPUT);
pinMode(clockPin2, OUTPUT);
pinMode(dataPin2, OUTPUT);
//Clear bitmap
for (int row = 0; row < 8; row++) {
for (int zone = 0; zone <= maxZoneIndex; zone++) {
bitmap[row][zone] = 0;
}
}
}
//FUNCTIONS
// Displays bitmap array in the matrix
void RefreshDisplay()
{
for (int row = 0; row < 8; row++) {
int rowbit = 1 << row;
digitalWrite(latchPin2, LOW);//Hold latchPin LOW for transmitting data
shiftOut(dataPin2, clockPin2, MSBFIRST, rowbit); //Transmit data
//Start sending column bytes
digitalWrite(latchPin1, LOW);//Hold latchPin LOW for transmitting data
//Shift out to each matrix
for (int zone = maxZoneIndex; zone >= 0; zone--)
{
shiftOut(dataPin1, clockPin1, MSBFIRST, bitmap[row][zone]);
}
//flip both latches at once to eliminate flicker
digitalWrite(latchPin1, HIGH);//Return the latch pin 1 high to signal chip
digitalWrite(latchPin2, HIGH);//Return the latch pin 2 high to signal chip
//Wait
delayMicroseconds(300);
}
}
// Converts row and colum to bitmap bit and turn it off/on
void Plot(int col, int row, bool isOn)
{
int zone = col / 8;
int colBitIndex = x % 8;
byte colBit = 1 << colBitIndex;
if (isOn)
bitmap[row][zone] = bitmap[y][zone] | colBit;
else
bitmap[row][zone] = bitmap[y][zone] & (~colBit);
}
// Plot each character of the message one column at a time, updated the display, shift bitmap left.
void XProcess()
{
for (int charIndex=0; charIndex < (sizeof(msg)-1); charIndex++)
{
int alphabetIndex = msg[charIndex] - '@';
if (alphabetIndex < 0) alphabetIndex=0;
//Draw one character of the message
// Each character is 5 columns wide, loop two more times to create 2 pixel space betwen characters
for (int col = 0; col < 7; col++)
{
for (int row = 0; row < 8; row++)
{
// Set the pixel to what the alphabet say for columns 0 thru 4, but always leave columns 5 and 6 blank.
bool isOn = 0;
if (col<5) isOn = bitRead( alphabets[alphabetIndex][col], 7-row ) == 1;
Plot( numCols-1, row, isOn); //Draw on the rightmost column, the shift loop below will scroll it leftward.
}
for (int refreshCount=0; refreshCount < scrollspeed; refreshCount++)
RefreshDisplay();
//Shift the bitmap one column to left
for (int row=0; row<8; row++)
{
for (int zone=0; zone < numZones; zone++)
{
//This right shift would show as a left scroll on display because leftmost column is represented by least significant bit of the byte.
bitmap[row][zone] = bitmap[row][zone] >> 1;
// Shift over lowest bit from the next zone as highest bit of this zone.
if (zone < maxZoneIndex) bitWrite(bitmap[row][zone], 7, bitRead(bitmap[row][zone+1],0));
}
}
}
}
}
void loop() {
XProcess();
}`
I have checked the power at every point including all 7, 74HC595 IC's. Every point is 5V+ dc
OK, now go and edit post #4 to fix the code there.
Should be done