102
Note:
PLEASE connect devices correctly. DO NOT wire up insufficiently. DO NOT connect to
the wrong side of the dot matrix. In the Fritzing image above, the side with label is at the
bottom.
For C language users:
Step 2: Get into the folder of code
cd
/
home
/
pi
/
SunFounder_Super_Kit_V3.0_for_Raspberry_Pi/C
Step 3: Compile
make 15_
dotMatrix
Step 4: Run
sudo
./
15_dotMatrix
Code Explanation
void hc595_in(unsigned char dat){
// Write an 8-bit data to the shift register of the
74HC595
int i;
for(i=0;i<8;i++){
digitalWrite(SDI, 0x80 & (dat << i));
// Write the value of dat to pin SDI of
the HC595 bit by bit
digitalWrite(SRCLK, 1);
// Everytime SRCLK adds one, the shift register moves 1
bit
delay(1);
digitalWrite(SRCLK, 0);
}
Содержание Super Kit 3.0
Страница 7: ...4 22 RGB LED 1 23 LED red 8 24 LED white 4 25 LED green 4 26 LED yellow 4 27 NPN Transistor S8050 2 ...
Страница 30: ...27 Also we have drawn a table of the corresponding BCM wiringPi and Name of each pins ...
Страница 78: ...75 Now pull the slide and you can see the two LEDs light up alternately ...