embeddedarduino-c++seven-segment-display

What changes has to be made to my original code?


I have written a code for DL1416 display it is a 4 digit 16 segments display. I need to test pd2816 display using arduino. The pd2816 is a 8 digit 18 segments display. Can someone help me out with what changes can be made to my actual code so that I can scroll the digits in the 8 digit instead of 4 and check all the segments in the PD 2816.... DL1416 datasheet

pd2816 its datasheet is avalable here


Solution

  • Although I'm not sure what stopped you from reading the datasheet you linked in your question I'll answer this

    The problem I am facing here is it is a 8 digit and how to scroll the numbers into all the 8 segments

    According to the datasheet you address the digit you want to write with signals A1,A2,A3 where you simply provide the bits of the desired digit.

    enter image description here

    So if you want to write the fifth digit, you provide the digit through D0-D7 and set the control inputs according to that table. 5 is 0b101 so A0 is HIGH, A1 is LOW, A2 is HIGH

    You might also think about the way you set those values without >600 explicit calls to digitalWrite

    Use a function that sets the outputs and store the combinations as numbers. 7 bits represent a number. So why not use that fact?

    As pins 0-7 are all on one port you can even use port manipulation.

    Instead of

      digitalWrite(0, HIGH);
      digitalWrite(1, LOW);
      digitalWrite(2, LOW);
      digitalWrite(3, LOW);
      digitalWrite(4, HIGH);
      digitalWrite(5, HIGH);
      digitalWrite(6, LOW);
      digitalWrite(7, LOW);
    

    You could simply write

    PORTD = 0b00110001;