Hi everyone!
Here is my problem: I tried to do the following assembly on my arduino Uno
... with the following code
iint DataPin = 11; //data
int LatchPin = 8; //STCP
int ClockPin = 12; //SHCP
int clock = 9; //CD4017 Pin14
int Reset = 10; //CD4017 Pin15
//x,y for the loop
int x;
int y;
// here the definion of all the letter(big ans small) and numbers
#define A {B00000000,B00111100,B01000010,B01000010,B01000010,B01111110,B01000010,B01000010,B01000010,B00000000}
#define B {B00000000,B01111100,B01000010,B01000010,B01111100,B01000010,B01000010,B01000010,B01111100,B00000000}
#define C {B00000000,B00111110,B01000000,B01000000,B01000000,B01000000,B01000000,B01000000,B00111110,B00000000}
#define D {B00000000,B01111100,B01000010,B01000010,B01000010,B01000010,B01000010,B01000010,B01111100,B00000000}
#define E {B00000000,B01111110,B01000000,B01000000,B01111100,B01000000,B01000000,B01000000,B01111110,B00000000}
#define F {B00000000,B01111110,B01000000,B01000000,B01111100,B01000000,B01000000,B01000000,B01000000,B00000000}
//etc.
#define num_0 {B00000000,B00111100,B01000110,B01001010,B01001010,B01001010,B01010010,B01100010,B00111100,B00000000}
#define num_1 {B00000000,B00001000,B00011000,B00001000,B00001000,B00001000,B00001000,B00001000,B00011100,B00000000}
#define num_2 {B00000000,B00111100,B01000010,B00000100,B00001000,B00010000,B00100000,B01000000,B01111110,B00000000}
#define num_3 {B00000000,B01111110,B00000010,B00000010,B00011100,B00000010,B00000010,B01000010,B00111100,B00000000}
#define num_4 {B00000000,B00000100,B00001100,B00010100,B00100100,B01000100,B01111110,B00000100,B00000100,B00000000}
#define num_5 {B00000000,B01111110,B01000000,B01000000,B00111100,B00000010,B00000010,B00000010,B01111100,B00000000}
#define num_6 {B00000000,B00111100,B01000000,B01000000,B01111100,B01000010,B01000010,B01000010,B00111100,B00000000}
#define num_7 {B00000000,B01111110,B00000010,B00000100,B00001000,B00010000,B00010000,B00010000,B00010000,B00000000}
#define num_8 {B00000000,B00111100,B01000010,B01000010,B00111100,B01000010,B01000010,B01000010,B00111100,B00000000}
#define num_9 {B00000000,B00111100,B01000010,B01000010,B01000010,B00111110,B00000010,B00000010,B00111100,B00000000}
#define times {B00000000,B00000000,B01000010,B00100100,B00011000,B00011000,B00100100,B01000010,B00000000,B00000000}
const int numPatterns = 17;//this is the number of patterns you want to display
byte patterns[numPatterns][10]={space,M,A,D,E,space,B,Y,space,V,A,D,I,M,space};// the patterns order
void setup(){
pinMode(DataPin,OUTPUT);
pinMode(ClockPin,OUTPUT);
pinMode(LatchPin,OUTPUT);
//simple stuff here
pinMode(clock,OUTPUT);
pinMode(Reset,OUTPUT);
//reseting the 4017 IC, you have to do this
digitalWrite(Reset,HIGH);
delayMicroseconds(5);
digitalWrite(Reset,LOW);
}
void display_pattern(int loops)//int loop acts like a delay, it take 8 mSecands to scan all of the rows so int loops = 15 is a good time for it
{
for(x=0;x<numPatterns-1;x++){ // loop over the patterns
for (int z=0;z<8;z++){ //scrolls one bite at a time
for(int t=0;t<loops;t++){// the delay we get with loops
for(y=0;y<10;y++){// loops over the array of bytes
byte temp = patterns[x][y];
byte temp_2=patterns[x+1][y];
digitalWrite(LatchPin, 0);
shiftOut(DataPin, ClockPin,MSBFIRST,((temp<<z)+(temp_2>>7-z)));//writes digital outputs, Z is for how much bites it need to scroll
digitalWrite(LatchPin, 1);
delayMicroseconds(800);
digitalWrite(LatchPin, 0);
shiftOut(DataPin, ClockPin,MSBFIRST,0);
digitalWrite(LatchPin, 1);
digitalWrite(clock,HIGH);
digitalWrite(clock,LOW);
}
}
}
}
}
void loop(){
display_pattern(7);// calls for the display_pattern function and says that int loop = 15(if you do more loop the pattern whould scrrol slower).
}
I tried with just the matrix 1 and the text is scrolling but with one pixel gap. The upper line is useless and the last line do not appears (maybe an assembling error I don't know).
I tried with the matrix 1 and 2. The matrix 2 displays the same as the matrix 1 but with one more pixel gap and the LED are less bright.
I think about using 74hc595 instead of cd4017 but I don't know how to wire i up.
One last thing: I wired the mass to GND plugg near the 5V on my arduino, is it good?
Thank you a lot guys!
PS: as you understood, I'm not english (I'm french) so I do apologise for ALL my mistakes.
