Tags: 7, segment, Digital, Display, 4bit, Digit, LED, Quad

7 segment LED Digital Display 4 - Quad Digits

  • 15.00 AED
    • Ex Tax:15.00 AED
    • Product Code: 4-bit LED
    • Availability: In Stock
    7 segment LED Digital Display 4 Digit are used in many day to day consumer devices like microwave ovens, washing machines, and air conditioners. They are a simple but effective way to display numerical data like time or quantity. Since they are made out of LEDs, they are a low cost option for d..

    7 segment LED Digital Display 4 Digit are used in many day to day consumer devices like microwave ovens, washing machines, and air conditioners. They are a simple but effective way to display numerical data like time or quantity. Since they are made out of LEDs, they are a low cost option for displaying information.

    Specification:

    Size: 42 x 24 x 12 mm
    Temperature display range: -9 to 60°C
    Temperature error correction setting feature, set the range: -5 to 5°C
    Working voltage: 3.3V~5V. (Note: the lower the voltage, the lower the luminance, the lower the power consumption)



    The Arduino Code for 7 segment LED Digital Display 4 - Quad Digits


    Easy way to control 7 segment displays by Arduino



    const int numberOfSegments = 8; // do not change

    int segmentPins[numberOfSegments] = {2,3,4,5,6,7,8,9}; // change to your pins a,b,c,d,e,f,g,DP

    const int numberOfDigits = 4; // change to the number of digits

    int commonPins[numberOfDigits] = {13,12,11,10}; // change to the pins of digits starting with the left digit


    int displayType=1; // change to the type of your display: common anode = 1; common cathode = 2;


    int myNumber=0;


    int theFigures[11][7]={

    {1,1,1,1,1,1,0},

    {0,1,1,0,0,0,0},

    {1,1,0,1,1,0,1},

    {1,1,1,1,0,0,1},

    {0,1,1,0,0,1,1},

    {1,0,1,1,0,1,1},

    {1,0,1,1,1,1,1},

    {1,1,1,0,0,0,0},

    {1,1,1,1,1,1,1},

    {1,1,1,0,0,1,1},

    {0,0,0,0,0,0,1}};


    void setup(){

    // config for the display

    for (int i=0; i<numberOfSegments;i++){

    pinMode(segmentPins[i],OUTPUT);

    }

    for (int i=0; i<numberOfDigits;i++){

    pinMode(commonPins[i],OUTPUT);

    }

    // type your setup code here

    }


    void loop(){

    // type in your loop code here

    // this is just for the example:

    showNumber(myNumber); // display the number

    if ( myNumber++;

    delay(1);


    }


    // do not change the methods below


    void showNumber(int theNumber){

    for (int stelle=numberOfDigits; stelle>=0; stelle--){

    char szZahl[numberOfDigits];

    sprintf(szZahl, "%d", theNumber);

    int stellen = strlen(szZahl);

    if (stelle > stellen) {

    } else {

    int ergebnis = szZahl[stelle] - '0';

    if (ergebnis>-1){

    digit(((numberOfDigits-1)-(stellen-(stelle+1))),ergebnis);

    }

    else {

    digit(((numberOfDigits-1)-(stellen-(stelle+1))),0);

    }

    }

    delay(1);

    clearDisplay();

    }

    }




    void digit(int theDigit, int theNumber){

    if (displayType==1){

    digitalWrite(commonPins[theDigit], HIGH);

    for (int i=0; i<7; i++){

    if (theFigures[theNumber][i]==0){

    digitalWrite(segmentPins[i],HIGH);

    } else {

    digitalWrite(segmentPins[i],LOW);

    }

    }

    } else {

    digitalWrite(commonPins[theDigit], LOW);

    for (int i=0; i<7; i++){

    digitalWrite(segmentPins[i],theFigures[theNumber][i]);

    }


    }

    }


    void clearDisplay(){

    for (int theDigit=0; theDigit<numberOfDigits;theDigit++){

    if (displayType==1){

    digitalWrite(commonPins[theDigit], LOW);

    for (int i=0; i<7; i++){

    digitalWrite(segmentPins[i],HIGH);

    }

    } else {

    digitalWrite(commonPins[theDigit], HIGH);

    for (int i=0; i<7; i++){

    digitalWrite(segmentPins[i],LOW);

    }

    }

    }

    }