7 Segment Display On Arduino - Instructables
Maybe your like
Introduction: 7 Segment Display on Arduino
This instructable shows how to display 0-9 digits on 7 Segment Display using Arduino.
What do you need:
- Arduino Uno 3
- 7 Seven Segment Display
- 2 x 220 Ohm Resistors
- Jumper Wires
Step 1: Making Connections
Connect the pins described below:
- Arduino Pin 2 to Pin 9.
- Arduino Pin 3 to Pin 10.
Arduino Pin 4 to Pin 4.
Arduino Pin 5 to Pin 2..
Arduino Pin 6 to Pin 1.
Arduino Pin 8 to Pin 7.
Arduino Pin 9 to Pin 6.
GND to Pin 3 and Pin 8 each connected with 220 ohm resistors.
Attachments
7 Segment Frizting Sketch.fzzDownload
Step 2: Arduino Code
int a = 2; //For displaying segment "a"int b = 3; //For displaying segment "b" int c = 4; //For displaying segment "c" int d = 5; //For displaying segment "d" int e = 6; //For displaying segment "e" int f = 8; //For displaying segment "f" int g = 9; //For displaying segment "g"void setup() { pinMode(a, OUTPUT); //A pinMode(b, OUTPUT); //B pinMode(c, OUTPUT); //C pinMode(d, OUTPUT); //D pinMode(e, OUTPUT); //E pinMode(f, OUTPUT); //F pinMode(g, OUTPUT); //G }void displayDigit(int digit) { //Conditions for displaying segment a if(digit!=1 && digit != 4) digitalWrite(a,HIGH); //Conditions for displaying segment b if(digit != 5 && digit != 6) digitalWrite(b,HIGH); //Conditions for displaying segment c if(digit !=2) digitalWrite(c,HIGH); //Conditions for displaying segment d if(digit != 1 && digit !=4 && digit !=7) digitalWrite(d,HIGH); //Conditions for displaying segment e if(digit == 2 || digit ==6 || digit == 8 || digit==0) digitalWrite(e,HIGH); //Conditions for displaying segment f if(digit != 1 && digit !=2 && digit!=3 && digit !=7) digitalWrite(f,HIGH); if (digit!=0 && digit!=1 && digit !=7) digitalWrite(g,HIGH); } void turnOff() { digitalWrite(a,LOW); digitalWrite(b,LOW); digitalWrite(c,LOW); digitalWrite(d,LOW); digitalWrite(e,LOW); digitalWrite(f,LOW); digitalWrite(g,LOW); } void loop() { for(int i=0;i<10;i++) { displayDigit(i); delay(1000); turnOff(); } }
Tag » Arduino 7 Segment Display Pin
-
Get Started With Seven Segment - Arduino Project Hub
-
One Digit 7-Segment LED Display - Arduino Project Hub
-
Create A 7-Segment Display! - Arduino Project Hub
-
How To Set Up Seven Segment Displays On The Arduino - Circuit Basics
-
How To Interface A Seven-Segment Display With An Arduino - Digikey
-
How To Interface 7 Segment Display With Arduino Uno - Linux Hint
-
Interface A Seven Segment Display To An Arduino - Projects
-
LED Displays With Arduino - 7-Segment & Dot-Matrix - YouTube
-
7-Segment Display Interfacing With Arduino UNO - ElectronicWings
-
Interfacing Seven Segment Display With Arduino - Circuit Digest
-
In-Depth: How Seven Segment Display Works & Interface With Arduino
-
Common Anode Seven Segment Display Interfaced With Arduino Uno
-
Using A 4×7 Segment Display With Arduino - AranaCorp
