Hello everyone, today we are here to learn, HOW TO INTERFACE SEVEN SEGMENT DISPLAY with ARDUINO. Seven Segments are used as an indication devices for display numbers electronically. You can see them easily in modern bike, cars, digital clock, calculators, etc.
So, today we will learn how to interface them with arduino. For this purpose you would require the following Components:
1. Arduino.
2. Seven Segment Display.
3. 1K Resistors x 10
4. BreadBoard.
5. Connecting Wires.
For the circuit Schematics, view the video. Once, the Circuit is assembled as per the schematic, you need to code the arduino on an Arduino IDE.
The code for Arduino is given here:
char seven[]={0x06,0xDB,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x67,0x3F};
//HEX CODES FOR 1 TO 9 AND 0
int i,j,temp,temp2; // DEFINING VARIABLES.
void setup()
{
for (i=2;i<10;i++)
{
pinMode(i,OUTPUT);// DEFINING NATURE OF PINS FOR SSD
}
}
void loop()
{
for(i=0;i<10;i++) // LOOP FOR DISPLAYING NUMBERS
{
temp2=seven[i];
for(j=2;j<9;j++)
{
temp=temp2 & 0x01; // MASKING TO DISPLAY ONE BIT AT A TIME.
temp2=(temp2>>1); // SHIFTING THE BITS STORED IN TEMP TO RIGHT.
digitalWrite(j,temp);
}
delay(1000);
}
} // SUBSCRIBE THE CHANNEL AND LIKE THE VIDEO PLS...
After uploading the code onto the arduino, your SSD is ready to work. Thus, you have easily interfaced a SSD with Arduino.
Continue making new things and using Arduino. See you soon. Till then enjoy learning. :)
Comments
Post a Comment