EasyManua.ls Logo

Freenove Ultimate Starter Kit - Page 215

Freenove Ultimate Starter Kit
286 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
215
Chapter 19 74HC595 & LED Matrix
█ www.freenove.com
support@freenove.com █
67
68
69
70
71
72
73
74
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
digitalWrite(latchPin,HIGH);//Output data of two stage 74HC595 at the
same time
x>>=1;// display the next column
delay( 1);
}
}
for(k=0;k<sizeof(data)-8;k++){ //sizeof(data) total number of "0-F" columns
for(j=0;j<20;j++){// times of repeated displaying LEDMatrix in every frame,
the bigger the “j”, the longer the display time
x= 0x80; // Set the column information to start from the first column
for(i=k;i<8+k;i++){
digitalWrite(latchPin,LOW);
_shiftOut(dataPin,clockPin,MSBFIRST,data[i]);
_shiftOut(dataPin,clockPin,MSBFIRST,~x);
digitalWrite(latchPin,HIGH);
x>>=1;
delay( 1);
}
}
}
}
r eturn 0;
}
The first “for” cycle in the “while” cycle is used to display a static smile. Display column information from left
to right, one column by one column, totally 8 columns. Repeat 500 times to ensure display time enough.
for(j=0;j<500;j++){// Repeat enough times to display the smiling face a period
of time
x=0x80;
for(i=0;i<8;i++){
digitalWrite(latchPin,LOW);
shiftOut(dataPin,clockPin,MSBFIRST,pic[i]);
shiftOut(dataPin,clockPin,MSBFIRST,~x);
digitalWrite(latchPin,HIGH);
x>>=1;
delay(1);
}
}

Table of Contents