Percobaan 2 kondisi 5
Tampilkan angka dari 5 sampai 1 secara berulang
2. Rangkaian Simulasi
[Kembali]
3. Video [Kembali]
4. Prinsip Kerja [Kembali]
pada percobaan 1 kondisi 5 tersebut dimana Ketika Rangkaian dijalankan, arduino akan menjalankan program sesuai dengan listing program yang telah di programkan melalui aplikasi arduino uno. pin input digital yaitu 2,3,4,5,6,7,8,9, terpasang ke pin seven segmen dimana pin 2= dp, pin 3= g, pin 4=f, pin 5=e, pin 6=d, pin 7=c, pin 8=b, pin 9=a. pin dp merupakan pin dot point atau titik. Ketika rangkaian hidup, maka seven segmen akan menampilkan angka 5,4,3,2,1 sesuai dengan listing program yang telah diprogram sebelumnya.
berikut listing programnya
byte sev_seg[] = {2,3,4,5,6,7,8,9};
void display_five() // Pin 6,7,8 High and 2,3,4,5 Low to display 7
{
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
digitalWrite(8,LOW);
digitalWrite(9,HIGH);
}
void display_four()// Pin 2,3,4,5,6,7,8 High to display 8
{
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
digitalWrite(9,LOW);
}
void display_three()// Pin 2,3,4,5,6,7,8 High to display 8
{
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
digitalWrite(6,HIGH);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
digitalWrite(9,HIGH);
}
void display_two()// Pin 2,3,4,5,6,7,8 High to display 8
{
digitalWrite(2,HIGH);
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);
digitalWrite(6,HIGH);
digitalWrite(7,LOW);
digitalWrite(8,HIGH);
digitalWrite(9,HIGH);
}
void display_one()// Pin 2,3,4,5,6,7,8 High to display 8
{
digitalWrite(2,LOW);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
digitalWrite(8,HIGH);
digitalWrite(9,LOW);
}
void setup() //Semua kode dalam fungsi ini hanya dieksekusi sekali
{
for(int i=0;i<9;i++)
{
pinMode(sev_seg[i],OUTPUT);
}
}
void loop() //Semua kode dalam fungsi ini di eksekusi berulang
{
display_five();
delay(1000); // 1 s delay
display_four();
delay(1000); // 1 s delay
display_three();
delay(1000); // 1 s delay
display_two();
delay(1000); // 1 s delay
display_one();
delay(1000); // 1 s delay
}
5. Link Download
[Kembali]
-html dwonload file
-video dwonload file
-Datasheet Arduino UNO download file
-Datasheet Seven Segment download file
-listing program download file
-simulasi rangkaian download file