0

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

  • What did you try? – user253751 Feb 17 '21 at 11:45
  • I removed the C tag as this is C++, so knowing the language you're dealing with is a good first stelp. I suggest you post some own attempt to improve the lazy impression you leave if you just post two datasheets and ask what to do. – Piglet Feb 17 '21 at 11:48
  • The above code is for four digit display i.e., it loops the ascii numbers mentioned in length and displays then on the segmented displays .but the other display is 8 digit and 18 segments the first_char(); next_char(); are parameters where I have written code for displaying first character and to loop the other characters in the concecutive digit places. So my doubt is for 8 digit what is the logic to proceed furthur. – Axel Blaze Feb 17 '21 at 11:56
  • yeah you already mentioned that. but what exactly is your expectation here? that we read through your 1125 lines of code and tell you what to do? don't you think you should show some own effort first? this is not a coding service. also I'd rather work on that code befor you adopt it to another display. have you heard of arrays and loops? you have > 600 digitalWrites in there. you can probably boild your code down to like 100-200 lines. you managed to get one display done, what stopps you from doing it for another one? – Piglet Feb 17 '21 at 11:59
  • The problem I am facing here is it is a 8 digit and how to scroll the numbers into all the 8 segments..? and – Axel Blaze Feb 17 '21 at 12:08
  • so why don't you ask this? you just aks for what to change in your 1125 lines of code. edit your post and explain what exactly you're struggling with – Piglet Feb 17 '21 at 12:11
  • Ok boss kindly adjust with this newbie....:P – Axel Blaze Feb 17 '21 at 12:29

1 Answers1

0

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;
Piglet
  • 27,501
  • 3
  • 20
  • 43