// 74HC595 Pins
const int dataPin = 2;
const int latchPin = 3;
const int clockPin = 4;
// Common Anode single segment patterns (gfedcba)
// Only ONE segment ON at a time (LOW = ON)
byte segments[] = {
0b11111110, // a
0b11111101, // b
0b11111011, // c
0b11110111, // d
0b11101111, // e
0b11011111, // f
0b10111111 // g
};
void setup() {
pinMode(dataPin, OUTPUT);
pinMode(latchPin, OUTPUT);
pinMode(clockPin, OUTPUT);
}
void loop() {
for (int digit = 0; digit < 5; digit++) {
for (int seg = 0; seg < 7; seg++) {
digitalWrite(latchPin, LOW);
// Send to 3 displays
for (int i = 4; i >= 0; i--) {
if (i == digit) {
shiftOut(dataPin, clockPin, MSBFIRST, segments[seg]);
} else {
shiftOut(dataPin, clockPin, MSBFIRST, 0xff); // all off
}
}
digitalWrite(latchPin, HIGH);
}
}
}cost: Rp.275.000,00~
5 x laser diode 5v = Rp.15.000~
5 x 7 SEG 2.30" = Rp. 50.000~
5 x 74HC595 = Rp.10.000~
5 x PNP transistor = Rp.2.000~
4 x ldr sensor module = Rp.20.000~
1 x arcade button = Rp.7.000~
1 x Reset button = Rp.3.000~
1 x servo 180 degree = Rp.16.000~
1 x 4ch relay = Rp.25.000~
1 x 1 ch relay = Rp.5.000~
1 x 12v led strip 5m = Rp.30.000~
1 x 3A psu = Rp.20.000~
1 x 12v led = Rp.5.000~
1 x Arduino Nano = Rp.30.000~
1 x step down 12v to 5v = Rp.10.000~
1 x 60leds/m ws2812b 12v = Rp.27.000~
START
Reset