Mturk Jobs

Mturk Jobs
Mturk Jobs

Tank

Thursday, January 3, 2019

How to use 7 segment display with Arduino?

In this post, you’ll see how it’s so easy to drive a seven segment display with an Arduino board.


The seven segment display is simply a group of seven LEDs connected together and placed inside a nice enclosure to give the shape of a number when those LEDs are illuminated with a certain combination.



Components you need

7 segment display

Arduino UNO or Arduino Mega or Arduino Micro

Some wires



Circuit



Code


void setup()
{
  // define pin modes
 pinMode(2,OUTPUT);
 pinMode(3,OUTPUT);
 pinMode(4,OUTPUT);
 pinMode(5,OUTPUT);
 pinMode(6,OUTPUT);
 pinMode(7,OUTPUT);
 pinMode(8,OUTPUT);
 }
void loop() 
{
  // loop to turn leds od seven seg ON
   for(int i=2;i<9;i++)
  {
    digitalWrite(i,HIGH);
    delay(600);
  }
  // loop to turn leds od seven seg OFF
  for(int i=2;i<9;i++)
  {
    digitalWrite(i,LOW);
    delay(600);
  } 
  delay(1000);
}

This shows how it's so easy to interface a seven segment display to the Arduino board.

Read this article on AeroArduino.com
Source:
https://www.allaboutcircuits.com/projects/interface-a-seven-segment-display-to-an-arduino/

Check our books on Amazon:





Learn By Making: Embedded Systems Tutorial for Students and Beginners








Embedded Systems, Electronics: My Projects Collection From Instructables

No comments:

Tank