# data[].attributes.attachment_link.title
19.- 7 LED Display7 segment display Introduction: A seven-segment display (SSD), or seven-segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot matrix displays. Seven-segment displays are widely used in digital clocks, electronic meters, basic calculators, and other electronic devices that display numerical information. As you can see in the picture, it is made up to 7 segments that are able to light up or down showing numbers. Actually, they are seven LEDs connected, creating an 8 number.  Each one of the display segments are known as a, b, c, d, e, f and g, as you can see in the picture. To be able to show the 0 number, we must light up the a, b, c, d, e and f led. To show the 2 number, we must light up the a, b, g, e, and d. We should do the same way to do any other number.  The P stands for the decimal colon.  We can classify this kind of display in two types: 1.	Segment display with common cathode, where all the LED’s cathodes are internally connected to a pin that should be connected to GND. 2.	Segment display with common anode, where all the LED’s are internally connected to a pin that should be connected to a positive pin hole. In our case, we have a common cathode display, the 5611AS (red light, digital size 0,56”, 14,2 mm).  CONEXIONS To work with this display, we must know what pin corresponds to what segment. We can check our case in the picture before. On the other hand, we have to connect each segment to an Arduino pin. In the example below we have use the following Arduino pins:  SEGMENT	PIN a	7 b	8 c	9 d	10 e	11 f	12 g	13       Exercise 1 First of all let’s test that all the connections are correct. Try this sketch: void setup()    {         for (int i = 6; i<13; i++)         pinMode(i, OUTPUT);    }  void loop()    {         for ( int j= 6; j<13 ; j++)   // Turn up ever segment            {               digitalWrite(j, HIGH);               delay(400) ;            }         for ( int j= 6; j<13 ; j++)   //Turn down all the segments               digitalWrite(j, LOW);         delay(400) ;    }  Exercise 2: Let’s do an example with our display. It will show al the number, ascendant way, in between 1 second. In this program, we introduce the “function” idea. Segmenting code into functions allows a programmer to create modular pieces of code that perform a defined task and then return to the area of code from which the function was "called". The typical case for creating a function is when one needs to perform the same action multiple times in a program. In our example we are going to define the “display” function. Here we have de sketch:   int pause=1000; // Variable to define the time each digit will show   void setup() {   pinMode(7, OUTPUT);  // Assign the digital outputs   pinMode(8, OUTPUT);   pinMode(9, OUTPUT);   pinMode(10, OUTPUT);   pinMode(11, OUTPUT);   pinMode(12, OUTPUT);   pinMode(13, OUTPUT); }   void display (int a, int b, int c, int d, int e, int f, int g) // Display function definition {   digitalWrite (7,a);   //We assign the 7 variables we have received   digitalWrite (8,b);   //each one to their output pin numbers   digitalWrite (9,c);   digitalWrite (10,d);   digitalWrite (11,e);   digitalWrite (12,f);   digitalWrite (13,g); }   void loop() //Main function // Depending each digit, we send ‘0’ or ‘1’ to the function “display”   {   display (1,1,1,1,1,1,0); //write 0   delay(pause);   display (0,1,1,0,0,0,0); //write 1   delay(pause);   display (1,1,0,1,1,0,1); //write 2   delay(pause);   display (1,1,1,1,0,0,1); //write 3   delay(pause);   display (0,1,1,0,0,1,1); //write 4   delay(pause);   display (1,0,1,1,0,1,1); //write 5   delay(pause);   display (1,0,1,1,1,1,1); //write 6   delay(pause);   display (1,1,1,0,0,0,0); //write 7   delay(pause);   display (1,1,1,1,1,1,1); //write 8   delay(pause);   display (1,1,1,0,0,1,1); //write 9   delay(pause); }  Save the sketch with the name “7 segment display”. 

# data[].attributes.attachment_link.title
Humiture Sensor  (Humidity and Temperature)

# data[].attributes.body
RGB

# data[].attributes.body
PWM

# data[].attributes.body
Sensors

# data[].attributes.body
Let´s start remembering something...

# data[].attributes.attachment_link.description
Get access to files anywhere through secure cloud storage and file backup for your photos, videos, files and more with Google Drive.