Go Down

Topic: SLR2016 5x7 LED OSRAM Opto Semiconductors and the Arduino code to run them (Read 18860 times) previous topic - next topic

PaulRB


brassbuilder

How's that third display coming along Mike?
It's not :(

I'm at a Microsoft Desktop Support Technician course for the next two weeks. I'm going to probably be tied up with that until almost Christmas.

And I kind of got sidetracked from the 3 displays. Now, I'm trying to figure out the code to just display a static message that doesn't scroll.

I'm slowly trying to go through the two books that I have too.

Mike

brassbuilder

Karma to PaulRB for all the great info in this thread.

brassbuilder, the most common type of displays that work like these are HP DL2416 displays. If you wanted to look at other examples and sketches I imagine you would find a lot by googling 'arduino DL2416.' Other popular displays were DL1414 and DL1416. They are all parallel input displays like yours. You would have to modify the examples, but it might be fun and you would learn a lot.

Jimmy

And thanks for this information! I googled it and it appears that there is a lot more info out there on the DL series than the SLRs that I am playing with.

Mike

brassbuilder

I have a curious little problem....

I set up another board because I did not want to take my working 2 display unit apart. That one is run on a UNO. I am now using a MEGA 2560.

When I load the code for the single scroll display....it scrolls, but it is random characters. I've taken this apart and rewired it (carefully) 3 times now.

If I load the code for the single digit to scroll A-Z, it scrolls from P-Z and tosses a few random characters in before it starts over at P.

I've made the setup changes in Sketch as far as telling it what board and COM port I'm using.

Am I missing anything else?

Mike

PaulRB

Post your list of pin connections and the updated sketch please Mike.

Given that P to Z show correctly, I would guess D0 to D3 are connected OK but one or more of D4, D5 or D6 are the problem. Either your wiring is still wrong/faulty or maybe you have used an unsuitable output on the mega.

Have a look at the table on page 6 of the data sheet:

http://media.digikey.com/pdf/Data%20Sheets/Osram%20PDFs/SLx2016.pdf

Do you see the "random characters" there? Which row on the table?

brassbuilder

Well that is interesting...

My "random characters" is the whole row 6 starting with "P" and ending with "_".

Is there a way to check the output ports on the Arduino?

I've wired this three times, I've moved the display to different areas of the breadboard, and I've used different jumper wires.

Mike

PaulRB

Post your list of pin connections and the updated sketch please Mike.
Also try swapping the display with one from the other circuit (you know those work).

To test an Arduino output, just load up the blink sketch, set it to the pin to be tested, and stick an led (+series resistor) on that output.

brassbuilder

Also try swapping the display with one from the other circuit (you know those work).

To test an Arduino output, just load up the blink sketch, set it to the pin to be tested, and stick an led (+series resistor) on that output.
Electronics 101

The jumper wire on pin 9 was not working....it didn't make the LED blink. I checked continuity through the jumper and....nothing. Replaced the jumper (checked continuity first) and checked continuity on the jumpers for pins 10 and 11 and everything is working perfectly again.

I knew it was going to be something simple I didn't think of....gotta remember to check those jumper wires from now on....

That blink program was kind of a fun little diversion :)

Now back to the static display.

Care to give me any hints on this Paul? :) I can't quite figure out how much of the code I can delete....

Mike



PaulRB

Well, if I remember, its the "for (byte p" loop that does the scrolling, so just take that out, and all references to "p". Limit your message to what will fit on the display (no leading/trailing spaces).

brassbuilder

Well, if I remember, its the "for (byte p" loop that does the scrolling, so just take that out, and all references to "p". Limit your message to what will fit on the display (no leading/trailing spaces).
That was easy. Took a couple of tries, but I got my message displayed. But it is in reverse....

Mike is ekiM

I suspect it is something to do with the ++ in the code....and since you had mentioned on page 3 of this post that the ++ was an increment variable, I tried moving the ++ on either side of the letters...that didn't do anything.....or maybe it has to do with one of the < signs.

I also tried replacing all the ++ with --.

ekiM :)


PaulRB

Odd, the scrolling message was not reversed. Post the sketch, I'll take a look.

brassbuilder

Odd, the scrolling message was not reversed. Post the sketch, I'll take a look.
Code: [Select]

const byte SLR2016_D[] = {5, 6, 7, 8, 9, 10, 11};

#define SLR2016_A0 4
#define SLR2016_A1 3
#define SLR2016_WR 2

char msg[] = "Mike";

void setup() {

  for (byte i = 0; i < 7; i++) {
    pinMode(SLR2016_D[i], OUTPUT);
  }

  pinMode(SLR2016_A0, OUTPUT);
  pinMode(SLR2016_A1, OUTPUT);
  pinMode(SLR2016_WR, OUTPUT);

}

void loop() {

  {
  
    for (byte c = 0; c < 4; c++) {
    
      digitalWrite(SLR2016_A0, bitRead(c, 0));
      digitalWrite(SLR2016_A1, bitRead(c, 1));
  
      for (byte i = 0; i < 7; i++) {
        digitalWrite(SLR2016_D[i], bitRead(msg[c], i));
      }
      
      digitalWrite(SLR2016_WR, LOW);
      digitalWrite(SLR2016_WR, HIGH);
    }
    
    delay(500);
  }
}


I left the delay in there, but I'm pretty sure it no longer serves a purpose.

Mike

PaulRB

Ok, I see it. In the scrolling text sketch there was this line:
Code: [Select]

  digitalWrite(SLR2016_D[i], bitRead(msg[p-c], i));


When you removed the reference to "p", you removed the "-" also. An easy mistake, but the fact that c was subtracted from p was what was preventing the scrolling message from getting reversed.

so to fix it...
Code: [Select]

  digitalWrite(SLR2016_D[i], bitRead(msg[3-c], i));


The reason it gets reversed is that, as we found out with that very first A-Z test sketch, that position zero is on the far right (like a purely numeric display), not on the left (as you might expect with a text display).

brassbuilder

Ok, I see it. In the scrolling text sketch there was this line:
Code: [Select]

  digitalWrite(SLR2016_D[i], bitRead(msg[p-c], i));


When you removed the reference to "p", you removed the "-" also. An easy mistake, but the fact that c was subtracted from p was what was preventing the scrolling message from getting reversed.

so to fix it...
Code: [Select]

  digitalWrite(SLR2016_D[i], bitRead(msg[3-c], i));


The reason it gets reversed is that, as we found out with that very first A-Z test sketch, that position zero is on the far right (like a purely numeric display), not on the left (as you might expect with a text display).
And that fixed it :)

Now....and I'm going to try to figure this out myself with all the code that I've received....I'm going to set up a second static display and I'm going to try for that third scrolling display....

I'll post back whether I succeed.

Been quite fun :)

Mike

brassbuilder

OK Paul....
I took a shot at that third display and I'm not quite there. Here is what I can tell you:

1. From the left display to the right display, my Write pins are numbered WR1, WR2, WR3

2. Displays 1 and 2 (the left and center display) is scrolling the phrase "Mary had a little lamb" just fine.

3. Display 3 is scrolling "Mary had a little lamb" on its own independent of the other two.

4. I am 99% sure my setup is correct.

5. I am 99% sure my problem is in the loop and it has something to do with that if...else statement. I tried to just add another else statement, but without a corresponding if statement, it will not compile. The code posted below compiles, but the phrase does not scroll from the farthest right display to the farthest left display. It's scrolling from the center display to the left display...and the right display is scrolling on its own. :(

Care to point out where I went wrong?

Mike

Here are my pinouts:

1   WR1   4
     WR2   3
     WR3   2
2   A1     5
3   A0     6
4   vCC   5v
5   D0     7
6   D1     8
7   D2     9
8   D3     10
9   D4     11
10  D5     12
11  D6    13
12  BL     5v
13  CL     5V
14  GND   GND

 
And here is the code:

Code: [Select]

const byte SLR2016_D[] = {7, 8, 9, 10, 11, 12, 13};

#define SLR2016_A0 6
#define SLR2016_A1 5
#define SLR2016_WR1 4
#define SLR2016_WR2 3
#define SLR2016_WR3 2

char msg[] = "       Mary had a little lamb       ";

void setup() {

  for (byte i = 0; i < 7; i++) {
    pinMode(SLR2016_D[i], OUTPUT);
  }

  pinMode(SLR2016_A0, OUTPUT);
  pinMode(SLR2016_A1, OUTPUT);
  pinMode(SLR2016_WR1, OUTPUT);
  pinMode(SLR2016_WR2, OUTPUT);
  pinMode(SLR2016_WR3, OUTPUT);

}

void loop() {

  for (byte p = 7; p <= 35; p++) {  
    
    /*the above code may need to be changed depending on the
    words you want scrolled. I've left 7 spaces in front and
    behind the scroll. I change the second number to one less digit than
    the total digits between the quotation marks. Otherwise,
    random characters have a tendency of showing up on the
    display */
  
    for (byte c = 0; c <= 7; c++) {
    
      digitalWrite(SLR2016_A0, bitRead(c, 0));
      digitalWrite(SLR2016_A1, bitRead(c, 1));
  
     for (byte i = 0; i < 7; i++) {
        digitalWrite(SLR2016_D[i], bitRead(msg[p-c], i));
      }
      
      if (c >= 4) {    
  digitalWrite(SLR2016_WR1, LOW);
  digitalWrite(SLR2016_WR1, HIGH); }
else {
  digitalWrite(SLR2016_WR2, LOW);
  digitalWrite(SLR2016_WR2, HIGH);
  digitalWrite(SLR2016_WR3, LOW);
  digitalWrite(SLR2016_WR3, HIGH);
}
    }
  
    delay(300);
       }
}


Go Up