LA 2 Modul 1 Praktikum Up&Uc





1. Hardware [Kembali]

  • Arduino Uno
  • Seven Segment



2. Rangkaian Simulasi [Kembali]


3. Listing Program dan Flowchart [Kembali]

  • Listing Program
byte sev_seg[] =  {2,3,4,5,6,7,8,9};



 void display_one() 

  {

      digitalWrite(2, HIGH);

      digitalWrite(3, LOW);

      digitalWrite(4, LOW);

      digitalWrite(5, HIGH);

      digitalWrite(6, HIGH);

      digitalWrite(7, HIGH);

      digitalWrite(8, HIGH);

      digitalWrite(9,HIGH);

}



 void display_two() 

  {

      digitalWrite(2, LOW);

      digitalWrite(3, LOW);

      digitalWrite(4, HIGH);

      digitalWrite(5, LOW);

      digitalWrite(6, LOW);

      digitalWrite(7, HIGH);

      digitalWrite(8, LOW);

      digitalWrite(9,HIGH);

}



 void display_three() 

  {

      digitalWrite(2, LOW);

      digitalWrite(3, LOW);

      digitalWrite(4, LOW);

      digitalWrite(5, LOW);

      digitalWrite(6, HIGH);

      digitalWrite(7, HIGH);

      digitalWrite(8, LOW);

      digitalWrite(9,HIGH);

}



 void display_four() 

  {

      digitalWrite(2, HIGH);

      digitalWrite(3, LOW);

      digitalWrite(4, LOW);

      digitalWrite(5, HIGH);

      digitalWrite(6, HIGH);

      digitalWrite(7, LOW);

      digitalWrite(8, LOW);

      digitalWrite(9,HIGH);

}



 void display_five() 

  {

      digitalWrite(2, LOW);

      digitalWrite(3, HIGH);

      digitalWrite(4, LOW);

      digitalWrite(5, LOW);

      digitalWrite(6, HIGH);

      digitalWrite(7, LOW);

      digitalWrite(8, LOW);

      digitalWrite(9,HIGH);

    

}



 void display_six() 

  {

      digitalWrite(2, LOW);

      digitalWrite(3, HIGH);

      digitalWrite(4, LOW);

      digitalWrite(5, LOW);

      digitalWrite(6, LOW);

      digitalWrite(7, LOW);

      digitalWrite(8, LOW);

      digitalWrite(9,HIGH);

}





 void display_seven() 

  {

      digitalWrite(2, LOW);

      digitalWrite(3, LOW);

      digitalWrite(4, LOW);

      digitalWrite(5, HIGH);

      digitalWrite(6, HIGH);

      digitalWrite(7, HIGH);

      digitalWrite(8, HIGH);

      digitalWrite(9,HIGH);

}



 void display_eight()

  {

      digitalWrite(2, LOW);

      digitalWrite(3, LOW);

      digitalWrite(4, LOW);

      digitalWrite(5, LOW);

      digitalWrite(6, LOW);

      digitalWrite(7, LOW);

      digitalWrite(8, LOW);

      digitalWrite(9,HIGH);

}



 void display_nine()

  {

      digitalWrite(2, LOW);

      digitalWrite(3, LOW);

      digitalWrite(4, LOW);

      digitalWrite(5, LOW);

      digitalWrite(6, HIGH);

      digitalWrite(7, LOW);

      digitalWrite(8, LOW);

      digitalWrite(9,HIGH);

}







 void setup()



  {



    for(int a = 0; a<9; a++)



    {



    pinMode(sev_seg[a], OUTPUT);   

    }



  }



 



  void loop()



  {

display_one();

delay(1000); 

display_two();

delay(1000); 

display_three();

delay(1000); 

display_four();

delay(1000); 

display_five();

delay(1000); 

display_six();

delay(1000); 

display_seven();

delay(1000); 

display_eight();

delay(1000); 

display_nine();

delay(1000); 

    

  }

  • Flowchart

4. Kondisi [Kembali]

    • Menampilkan secara bergantian dari angka 9 - 1 


    5. Video Simulasi dan Prinsip Kerja [Kembali]

    • Video rangkaian menampilkan secara bergantian 1-9


    • Prinsip Kerja

    Pin 2    :  a

    Pin 3    :  b

    Pin 4    :  c

    Pin 5    :  d

    Pin 6    :  e

    Pin 7    :  f

    Pin 8    :  g

    Pin 9    :  DP

    Pada percobaan, Rangkaian dirangkai sesuai dengan kondisi yang diminta, yaitu untuk menampilkan angka 9-1 secara berurut. Kaki-kaki pada pin Arduino dihubungkan ke 7 Segment  Setelah seluruh pin terhubung, maka rangkaian dihubungkan listing program, maka pada 7 Segment akan menunjukkan angka 9-1 secara berurutn sesuai dengan perintah.



    6. Analisa [Kembali]

    Percobaan 2 Kondisi 2

    1. Jelaskan perbedaan program yang digunakan saat menggunakan seven segment tipe common anoda dan tipe common katoda

    Jawab:

    Saat menggunakan seven segment common katoda, maka seven segment akan aktif saat diberi logika yang outputnya 1 atau HIGH, sehingga LED dapat menyala.

    Namun, saat menggunakan seven segment common anoda maka seven segment akan aktif saat diberi logika yang outputya 0 atau LOW, sehingga LED dapat menyala.



    7. Link Download [Kembali]

    Download File Rangkaian
    Download Video Rangkaian











    Tidak ada komentar:

    Posting Komentar