>Seven Segment Dengan Menggunakan Arduino

>

7 segment

1.      Microcontroller
arduino
                             i.     Arduino Duemilanov ATMega 328 (1 buah)
2.      Resistor
resistor

                            i.      Resistor 220 Ω (1 buah)

3.      Seven Segment
                         i.          7 Segment Anode (1 buah)
7 segment

4.      Kabel Penghubung

                         i.          Kabel Pelangi (Secukupnya)
kabel pelangi

5.      Bread Board

breadboard

void setup(){
for(int i=0;i<7;i++){
pinMode(i,OUTPUT);
}
}
void tampil(byte a1, byte a2, byte a3, byte a4, byte a5, byte a6, byte a7){
digitalWrite(0,a1);
digitalWrite(1,a2);
digitalWrite(2,a3);
digitalWrite(3,a4);
digitalWrite(4,a5);
digitalWrite(5,a6);
digitalWrite(6,a7);
}
void loop(){
           tampil(0,0,0,1,0,0,0);
           delay(500);
           tampil(1,0,0,1,0,0,0);
           delay(500);
           tampil(1,0,0,0,0,0,1);
           delay(500);
           tampil(1,1,1,1,1,1,1);
           delay(500);
           tampil(0,0,0,0,0,0,0);
           delay(500);
           tampil(1,1,1,1,0,0,1);
           delay(500);
           tampil(0,1,0,0,1,0,0);
           delay(500);
           tampil(0,0,0,1,0,0,0);
           delay(500);
           tampil(1,1,1,1,1,1,1);
           delay(500);
}
Print Friendly, PDF & Email