EasyManua.ls Logo

SunFounder 3in1 Kit - Page 165

Default Icon
351 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...
SunFounder 3in1 Kit
Wiring
Code
Note:
Open the 5.9.shiftout_led.ino file under the path of 3in1-kit\learning_project\5.9.
shiftout_led.
Or copy this code into Arduino IDE.
When you finish uploading the codes to the R4 board, you can see the LEDs turning on one after another.
How it works?
Declare an array, store several 8 bit binary numbers that are used to change the working state of the eight LEDs con-
trolled by 74HC595.
int datArray[] = {B00000000, B00000001, B00000011, B00000111, B00001111, B00011111,
˓B00111111, B01111111, B11111111};
Set STcp to low level first and then high level. It will generate a rising edge pulse of STcp.
digitalWrite(STcp,LOW);
4.5. 5. More Syntax 161

Related product manuals