Digital Clock With 8 Digits 7 Segment Module Without RTC
Digital Clock With 8 Digits 7 Segment Module Without RTC
RTC)
www.belajarduino.com /2016/08/digital-clock-with-8-digits-7-segment.html
Disini kita akan belajar membuat sebuah Jam Digital sederhana,karena hanya membutuhkan 1 unit 8 digit
Seven Segmen (dengan 1 IC Max7219) dan Sebuat controller Arduino (Uno/Nano/Pro mini).
Disini kita dapat menambah kan Opsi 3 buat push button sebagai tombol setting manual Jam nya.
1/7
Schematic 8 Digits 7 Segment Display dengan Single
Controller Max7219
2/7
Library Arduino yang kita butuhkan :
Extract dan masukan Library yang dibutuhkan diatas (salah satu saja) ke dalam folder Libraries Arduino
wiring Module Display 8digit 7segment ke Arduino (Uno) // Arduino Pin D12 to DIN 8digit 7segment
kita tidak perlu memberikan Resistor Pull-Up seperti pada gambar karena kita akan memakai
3/7
internal R Pullup milik Digital Pin Arduino.
Copy paste sourche code dibawah ini ke dalam Arduino IDE kemudian upload ke Arduino Board Anda. Anda
juga bisa download .ino file nya disini.
lc.setDigit(0,7,hh2,false);
lc.setDigit(0,6,hh1,false);
lc.setChar(0,5,'-',false);
lc.setDigit(0,4,mm2,false);
lc.setDigit(0,3,mm1,false);
lc.setChar(0,2,'-',false);
lc.setDigit(0,1,ss2,false);
lc.setDigit(0,0,ss1,false);
setupClock ();
}
//////////////////////////////////////////
// Example by Dani Rajacell //
// Mohon tetap mencantumkan sumber //
//apabila menggunakan example kode ini //
//////////////////////////////////////////
void setupClock (void) {
btnUP.read(); //read the buttons 5/7
btnUP.read(); //read the buttons
btnDN.read();
btnSET.read();
STATE = WAIT;
break;
case DECR: //decrement the counter
if (setMode==1 && ss2>0)ss2=ss2-1;
if (setMode==0 && ss1>0)ss1=ss1-1;
if (setMode==4 && mm2>0)mm2=mm2-1;
if (setMode==3 && mm1>0)mm1=mm1-1;
if (setMode==7 && hh2>0)hh2=hh2-1;
if (setMode==6 && hh1>0)hh1=hh1-1;
STATE = WAIT;
break;
}
}
//////////////////////////////////////////
// Example by Dani Rajacell //
// Mohon tetap mencantumkan sumber //
//apabila menggunakan example kode ini //
//////////////////////////////////////////
void writeSetup() { 6/7
void writeSetup() {
lc.setDigit(0,7,5,false);
lc.setChar(0,6,'e',false);
lc.setRow(0,5,B00001111);
lc.setRow(0,4,B00111110);
lc.setChar(0,3,'p',false);
lc.setChar(0,2,'-',false);
lc.setChar(0,1,'-',false);
lc.setChar(0,0,'-',false);
delay(1000);
if(ss1<9)ss1=ss1+1;
lc.clearDisplay(0);
}
void writeFinish() {
lc.setRow(0,7,B01000111);
lc.setRow(0,6,B00110000);
lc.setRow(0,5,B00010101);
lc.setRow(0,4,B00110000);
lc.setDigit(0,3,5,false);
lc.setRow(0,2,B00010111);
lc.setChar(0,1,'-',false);
lc.setChar(0,0,'-',false);
delay(1000);
if(ss1<9)ss1=ss1+1;
lc.clearDisplay(0);
}
void writeRJC() {
lc.setRow(0,7,B11000110);
lc.setRow(0,6,B11111101);
lc.setRow(0,5,B10111000);
lc.setRow(0,4,B11111101);
lc.setRow(0,3,B11001110);
lc.setRow(0,2,B11101111);
lc.setRow(0,1,B10001110);
lc.setRow(0,0,B10001110);
delay(2000);
lc.clearDisplay(0);
}
7/7