/*
Two shift registers are daisy chained.
Flying segments
*/
int DS_pin = 2;
int STCP_pin = 3;
int SHCP_pin = 4; // clock
// Segment codes for animation (common anode)
byte segment_codes[7] = {
0xBF, // G
0xDF, // F
0xEF, // E
0xF7, // D
0xFB, // C
0xFD, // B
0xFE // A
};
int dec_digits [10] {1, 79, 18, 6, 76, 36, 32, 15, 0, 4};
void setup() {
pinMode(DS_pin, OUTPUT);
pinMode(STCP_pin, OUTPUT);
pinMode(SHCP_pin, OUTPUT);
}
/*
// __ 0 1 2 3 4 5 6 7 8 9
//00H 3FH 06H 5BH 4FH 66H 6DH 7DH 07H 7FH 6FH
*/
void loop() {
for (int i = 0; i < 6; i++) {
digitalWrite(STCP_pin, LOW);
shiftOut(DS_pin, SHCP_pin, LSBFIRST, segment_codes[i]);
shiftOut(DS_pin, SHCP_pin, LSBFIRST, segment_codes[i]);
digitalWrite(STCP_pin, HIGH);
delay(50);
}
}
nano1:12
nano1:11
nano1:10
nano1:9
nano1:8
nano1:7
nano1:6
nano1:5
nano1:4
nano1:3
nano1:2
nano1:GND.2
nano1:RESET.2
nano1:0
nano1:1
nano1:13
nano1:3.3V
nano1:AREF
nano1:A0
nano1:A1
nano1:A2
nano1:A3
nano1:A4
nano1:A5
nano1:A6
nano1:A7
nano1:5V
nano1:RESET
nano1:GND.1
nano1:VIN
nano1:12.2
nano1:5V.2
nano1:13.2
nano1:11.2
nano1:RESET.3
nano1:GND.3
sr1:Q1
sr1:Q2
sr1:Q3
sr1:Q4
sr1:Q5
sr1:Q6
sr1:Q7
sr1:GND
sr1:Q7S
sr1:MR
sr1:SHCP
sr1:STCP
sr1:OE
sr1:DS
sr1:Q0
sr1:VCC
sevseg1:COM.1
sevseg1:COM.2
sevseg1:A
sevseg1:B
sevseg1:C
sevseg1:D
sevseg1:E
sevseg1:F
sevseg1:G
sevseg1:DP
r1:1
r1:2
r2:1
r2:2
r3:1
r3:2
r4:1
r4:2
r5:1
r5:2
r6:1
r6:2
r7:1
r7:2
sr2:Q1
sr2:Q2
sr2:Q3
sr2:Q4
sr2:Q5
sr2:Q6
sr2:Q7
sr2:GND
sr2:Q7S
sr2:MR
sr2:SHCP
sr2:STCP
sr2:OE
sr2:DS
sr2:Q0
sr2:VCC
r8:1
r8:2
r9:1
r9:2
r10:1
r10:2
r11:1
r11:2
r12:1
r12:2
r13:1
r13:2
r14:1
r14:2
sevseg2:COM.1
sevseg2:COM.2
sevseg2:A
sevseg2:B
sevseg2:C
sevseg2:D
sevseg2:E
sevseg2:F
sevseg2:G
sevseg2:DP