- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplayArray.ino
More file actions
Latest commit
26 lines (24 loc) · 725 Bytes
/
Copy pathdisplayArray.ino
File metadata and controls
26 lines (24 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//You can test it by connecting leds to your 74hc595 outputs
//Shift register inputs
#defineSER13// the next data to add to the register
#defineRCK12// the register validation
#defineSRCK8// the shift register clock
#defineREGS1// shift register number
//including the library.
#include<ShiftRegister.h>
//instantiate
ShiftRegister sr(SER, RCK, SRCK, REGS);
voidsetup() {
//setup the arduino pins
sr.setup();
sr.allBitsLow();//if you want to reset bits on startup
}
bool data1[] = {0, 0, 0, 0, 1, 1, 1, 1};
bool data2[] = {1, 1, 1, 1, 0, 0, 0, 0};
constint dataSize = 8; // The array length.
voidloop() {
sr.display(data1, dataSize);
delay(1000);
sr.display(data2, dataSize);
delay(1000);
}