TP 2 Mikro

 



1. Kondisi [Kembali]
Kondisi yang digunakan pada Tugas Pendahuluan ini adalah Percobaan 1 kondisi 7 yaitu Tampilkan angka dari 9 sampai 1 secara berulang

Kondisi awal :


2. Hardware [Kembali]



3. Rangkaian Simulasi dan Prisnip kerja [Kembali]


Rangkaian terdapat arduino(simulino uno) yang memiliki input dan pin groundnya terhubung ke ground. Pin output yang digunakan adalah Pin 2,3,4,5,6,7,8,9 yang masing-masing pin terhubung secara berurutan ke 7-segment dengan kakinya yaitu A,B,C,D,E,F,G,DP lalu terhubung ke ground. untuk mensimulasikan rangkaian maka perlu dibuat program untuk arduino (simulino uno) .listing program telah terdapat dibawah.

    Setelah selesai program maka kita masukkan program ke perangkat arduino(simulino uno). saat dijalan kan arus dari simulino uno ke  7-segment, pada mulanya semua 7-segment dari mati  lalu 7-segment akan menampilkan anka dari 9 ke 1 dengan delay selama 500 ms (0,5detik)  dan begitu seterusnya.




4. Listing Program [Kembali]
byte pin[] = {2, 3, 4, 5, 6, 7, 8, 9}; 
void setup() {
pinMode (2,OUTPUT);
pinMode (3,OUTPUT);
pinMode (4,OUTPUT);
pinMode (5,OUTPUT);
pinMode (6,OUTPUT);
pinMode (7,OUTPUT);
pinMode (8,OUTPUT);
pinMode (9,OUTPUT);
}
void loop() {
  nine();
  eight();
  seven();
  six();
  five();
  four();
  three();
  two();
  one();
}

void one(){
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
delay(500);
}

void two(){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
delay(500); 
}

void three (){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
delay(500);
}

void four(){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
delay(500);
}

void five(){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
delay(500);
}

void six(){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
delay(500);
}

void seven(){
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
delay(500);
}

void eight(){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
delay(500);
}

void nine(){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
delay(500);
}
5. Video [Kembali]


6. Link Download [Kembali]
HTML - download
Simulasi Proteus - download
Listing Program - download
Video - download




Tidak ada komentar:

Posting Komentar