Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
44 views

Arduino Seven Segment

A seven segment display consists of 7 LED segments arranged in the shape of a figure 8, where each segment is an LED with one of its terminals connected in common. The document then provides a diagram labeling the 7 segments a through g. It proceeds to describe a circuit using an Arduino UNO to control a common anode seven segment display by cycling through the digits 0 to 9 using a simple program.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Arduino Seven Segment

A seven segment display consists of 7 LED segments arranged in the shape of a figure 8, where each segment is an LED with one of its terminals connected in common. The document then provides a diagram labeling the 7 segments a through g. It proceeds to describe a circuit using an Arduino UNO to control a common anode seven segment display by cycling through the digits 0 to 9 using a simple program.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Arduino Seven Segment 

Pada Umumnya seven segment terdiri 7 batang led yang disusun membentuk angka 8 dimana
setiap segmentnya terdiri dari LED yang salah satu kaki terminal lednya di jadikan satu atau
yang disebut dengan common. 

skema dari 7 batang led tadi biasanya di tandai dengan huruf a - g, sebagai berikut

Alat dan Bahan


 1 Buah Seven Segment (Common Anode)
 1 Buah Resistor 220 Ω (Ohm)
 Kabel Jumper secukupnya
 1 Buah Protoboard
 1 Buah Arduino
Rangkaian Seven Segment Menggunakan Arduino UNO – dan Counter 0 sampai 9

 masukkan program berikut di arduino software 


// www.arduino.web.id
// urut dari 0 - 9
// untuk 7segment common katoda, jika menggunakan common Anoda, silahkan dganti
"1" dengan "0"

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);
  digitalWrite(9, 0);  // start with the "dot" off
}

void loop() {
   // write '0'
 digitalWrite(2, 1);
 digitalWrite(3, 1);
 digitalWrite(4, 1);
 digitalWrite(5, 1);
 digitalWrite(6, 1);
 digitalWrite(7, 1);
 digitalWrite(8, 0);
 delay(500);
  // write '1'
 digitalWrite(2, 0);
 digitalWrite(3, 1);
 digitalWrite(4, 1);
 digitalWrite(5, 0);
 digitalWrite(6, 0);
 digitalWrite(7, 0);
 digitalWrite(8, 0);
 delay(500);
 // write '2'
 digitalWrite(2, 1);
 digitalWrite(3, 1);
 digitalWrite(4, 0);
 digitalWrite(5, 1);
 digitalWrite(6, 1);
 digitalWrite(7, 0);
 digitalWrite(8, 1);
 delay(500);
  // write '3'
 digitalWrite(2, 1);
 digitalWrite(3, 1);
 digitalWrite(4, 1);
 digitalWrite(5, 1);
 digitalWrite(6, 0);
 digitalWrite(7, 0);
 digitalWrite(8, 1);
 delay(500);
  // write '4'
 digitalWrite(2, 0);
 digitalWrite(3, 1);
 digitalWrite(4, 1);
 digitalWrite(5, 0);
 digitalWrite(6, 0);
 digitalWrite(7, 1);
 digitalWrite(8, 1);
 delay(500);
 // write '5'
 digitalWrite(2, 1);
 digitalWrite(3, 0);
 digitalWrite(4, 1);
 digitalWrite(5, 1);
 digitalWrite(6, 0);
 digitalWrite(7, 1);
 digitalWrite(8, 1);
 delay(500);
// write '6'
 digitalWrite(2, 1);
 digitalWrite(3, 0);
 digitalWrite(4, 1);
 digitalWrite(5, 1);
 digitalWrite(6, 1);
 digitalWrite(7, 1);
 digitalWrite(8, 1);
 delay(500);
// write '7'
 digitalWrite(2, 1);
 digitalWrite(3, 1);
 digitalWrite(4, 1);
 digitalWrite(5, 0);
 digitalWrite(6, 0);
 digitalWrite(7, 0);
 digitalWrite(8, 0);
 delay(500);
 // write '8'
 digitalWrite(2, 1);
 digitalWrite(3, 1);
 digitalWrite(4, 1);
 digitalWrite(5, 1);
 digitalWrite(6, 1);
 digitalWrite(7, 1);
 digitalWrite(8, 1);
 delay(500);
 // write '9'
 digitalWrite(2, 1);
 digitalWrite(3, 1);
 digitalWrite(4, 1);
 digitalWrite(5, 0);
 digitalWrite(6, 0);
 digitalWrite(7, 1);
 digitalWrite(8, 1);
 delay(2000);

You might also like