Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: limel on Mar 01, 2014, 11:39 am

Title: LED DOT MATRIX 64x16
Post by: limel on Mar 01, 2014, 11:39 am
Instead I make a dot matrix LED display, I decided to payment already made ??display.

http://www.canton-electronics.com/375mm-64x16-dot-matrix-led-display-for-arduino-uno-r3-mega2560-mcu-sign-project-p-753.html (http://www.canton-electronics.com/375mm-64x16-dot-matrix-led-display-for-arduino-uno-r3-mega2560-mcu-sign-project-p-753.html)

I trusted the seller's promises: "With the display you get full documentantion and example sketch".

So far I have found that complete documentation is only one demo program which shows the pre-generated text. At my request the seller for additional documentation is a response "that is it".

Code: [Select]
//Author: cantone-electonics
//More information welcome to : http://www.canton-electronics.com
//Arduino 1.0.4
//Arduino uno R3
//64x16 Matrix LED

#define COL_PIXEL     64
#define ROW_PIXEL     16

int latchPin=8; //LT
int clockPin=12;//SK
int dataPin=11; //R1

int en_74138 = 2;
int la_74138 = 3;
int lb_74138 = 4;
int lc_74138 = 5;
int ld_74138 = 6;

unsigned int ROW_xPixel;
unsigned int ROW_num;
unsigned char Col_num_1;
unsigned char Col_num_2;
unsigned char Col_num_3;
unsigned char Col_num_4;
unsigned char Col_num_5;
unsigned char Col_num_6;
unsigned char Col_num_7;
unsigned char Col_num_8;


//Data code: Horizontal modulus ,Bytes reverse order
unsigned char  Bmp1[]=
{
/*------------------------------------------------------------------------------
;  Width X height (pixels): 64X16
;I Love You
------------------------------------------------------------------------------*/
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0, 0xff, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0xc0, 0x0, 0x0, 0x0,
0x0, 0x0, 0xc, 0x0, 0x3, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0xc0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0x0, 0x3, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x30, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc, 0x0, 0x3, 0xc0, 0x3, 0x3, 0x30, 0xf0, 0x0, 0xc0, 0xc,
0xf0, 0xc0, 0x0, 0x3, 0x0, 0xc, 0x0, 0x3, 0x30, 0xc, 0x3, 0x30, 0xc, 0x3, 0x0, 0x3, 0xc, 0xc3, 0x0, 0x3, 0x0, 0xc,
0x0, 0x3, 0xc, 0x30, 0x3, 0x30, 0x3, 0xc, 0x0, 0x3, 0x3, 0xcc, 0x0, 0x3, 0x0, 0xc, 0x0, 0x3, 0xc, 0x30, 0x3, 0x30,
0x3, 0xc, 0x0, 0x3, 0x3, 0xcc, 0x0, 0x3, 0x0, 0xc, 0x0, 0x3, 0xc, 0x30, 0x3, 0x30, 0xf, 0xc, 0x0, 0x3, 0x3, 0xcc,
0x0, 0x3, 0x0, 0xc, 0x0, 0x3, 0xc, 0x30, 0x3, 0x30, 0xf3, 0x3, 0x0, 0x3, 0x3, 0xcc, 0x0, 0x3, 0x0, 0xc, 0x0, 0x3,
0xc, 0x30, 0xc, 0xc, 0x3, 0x0, 0x0, 0x3, 0x3, 0xcc, 0x0, 0x3, 0x0, 0xc, 0x0, 0xc3, 0x30, 0xc, 0x30, 0x3, 0x3, 0xc,
0x0, 0x3, 0xc, 0xc3, 0x0, 0x3, 0xc0, 0xff, 0x0, 0xff, 0xc0, 0x3, 0xc0, 0x0, 0xfc, 0x3, 0x0, 0x3, 0xf0, 0x0, 0xff,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};



unsigned char  Bmp2[]=
{
/*------------------------------------------------------------------------------
; Width X height (pixels): 16X16
;WELCOME 64 16
------------------------------------------------------------------------------*/
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3c, 0x30, 0xf0, 0xfc, 0xff, 0x3c, 0x0,
0xf0, 0x3f, 0xf0, 0xf, 0x3c, 0x0, 0xcf, 0xff, 0x3f, 0x3c, 0xf0, 0xf0, 0xfc, 0xff, 0x3c, 0x0, 0xfc, 0x3f, 0xfc, 0x3f, 0x3c,
0x0, 0xcf, 0xff, 0x3f, 0x3c, 0xf0, 0xf0, 0x3c, 0x0, 0x3c, 0x0, 0xf, 0x0, 0xf, 0xf0, 0x3c, 0x0, 0xcf, 0x3, 0x0, 0x3c, 0xfc,
0xf0, 0x3c, 0x0, 0x3c, 0x0, 0xf, 0x0, 0xf, 0xf0, 0xfc, 0xc0, 0xcf, 0x3, 0x0, 0x3c, 0xfc, 0xf0, 0x3c, 0x0, 0x3c, 0x0, 0xf,
0x0, 0xf, 0xf0, 0xfc, 0xf0, 0xcf, 0x3, 0x0, 0xfc, 0xfc, 0xfc, 0xfc, 0xff, 0x3c, 0x0, 0xf, 0x0, 0xf, 0xf0, 0xfc, 0xf3, 0xcf,
0xff, 0x3f, 0xf0, 0xfc, 0x3c, 0xfc, 0xff, 0x3c, 0x0, 0xf, 0x0, 0xf, 0xf0, 0x3c, 0x3f, 0xcf, 0xff, 0x3f, 0xf0, 0xfc, 0x3c,
0x3c, 0x0, 0x3c, 0x0, 0xf, 0x0, 0xf, 0xf0, 0x3c, 0x3f, 0xcf, 0x3, 0x0, 0xf0, 0xfc, 0x3c, 0x3c, 0x0, 0x3c, 0x0, 0xf, 0x0,
0xf, 0xf0, 0x3c, 0x3f, 0xcf, 0x3, 0x0, 0xf0, 0xff, 0x3f, 0x3c, 0x0, 0x3c, 0x0, 0xf, 0x0, 0xf, 0xf0, 0x3c, 0x3f, 0xcf, 0x3,
0x0, 0xf0, 0xff, 0x3f, 0x3c, 0x0, 0x3c, 0x0, 0xf, 0x0, 0xf, 0xf0, 0x3c, 0x3f, 0xcf, 0x3, 0x0, 0xc0, 0xcf, 0xf, 0x3c, 0x0,
0x3c, 0x0, 0xf, 0x0, 0xf, 0xf0, 0x3c, 0xf, 0xcf, 0x3, 0x0, 0xc0, 0xcf, 0xf, 0xfc, 0xff, 0xfc, 0xff, 0xfc, 0x3f, 0xfc, 0x3f,
0x3c, 0xc, 0xcf, 0xff, 0x3f, 0x0, 0x3, 0x3, 0xfc, 0xff, 0xfc, 0xff, 0xf0, 0x3f, 0xf0, 0xf, 0x3c, 0xc, 0xcf, 0xff, 0x3f, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};


void shiftOut(unsigned char dataOut)
{
 
   for(int i=0;i<=7;i++)
  {
     PORTB &=~(1<<(clockPin-8));//equate digitalWrite(clockPin,LOW);
     
    if(dataOut & (0x01<<i))  PORTB |=1<<(dataPin-8); //equate digitalWrite(dataPin,HIGH);
    else  PORTB &=~(1<<(dataPin-8));//equate digitalWrite(dataPin,LOW);
   
    PORTB |=1<<(clockPin-8);//equate digitalWrite(clockPin,HIGH);
   
  }
}

//Combine 2 bits/pixel to 1 bits/pixel
unsigned char Combine_2BitsTo1Bit(unsigned char num,unsigned char *BMP)
{
 
 unsigned char Col_num_tem_1;
 unsigned char Col_num_tem_2;
 unsigned int Col_num_tem = 0;
 unsigned char i=0;
 unsigned char Col_num_1bit = 0x00;
 
 Col_num_tem_1 = *(BMP+num);
 Col_num_tem_2 = *(BMP+num+1);
 
 Col_num_tem = Col_num_tem_1;
 Col_num_tem |= (Col_num_tem_2 << 8);
 
for(i=0;i<8;i++)
 {  
   if(Col_num_tem&(0x0003<<i*2)) Col_num_1bit |= (0x01<<i);
 }
 return ~Col_num_1bit;
}

//display one picture
void display_martix(unsigned char *BMP)
{
 //Display count
 unsigned int dis_cnt=256;
 unsigned int i;
 
  for(i=0;i<dis_cnt*16;i++)
  {
   
    digitalWrite(en_74138, HIGH);//Turn off display
 
    //Col scanning
   shiftOut(Col_num_1);
   shiftOut(Col_num_2);
   shiftOut(Col_num_3);
   shiftOut(Col_num_4);
   shiftOut(Col_num_5);
   shiftOut(Col_num_6);
   shiftOut(Col_num_7);
   shiftOut(Col_num_8);
 
   digitalWrite(latchPin, LOW);
   digitalWrite(latchPin, HIGH);
 
   //Row scanning
   // AVR Port Operation
   PORTD = ((ROW_xPixel << 3 ) & 0X78) | (PORTD & 0X87);//Write PIN 3 4 5 6 la_74138 lb_74138 lc_74138 ld_74138
   
   digitalWrite(en_74138, LOW);//Turn on display
 

   
   if(ROW_xPixel==15) ROW_xPixel=0; else ROW_xPixel++;
 
  /*
  // Single color,1 bits/pixel
  Col_num_1=~BMP[(COL_PIXEL/8)*ROW_xPixel];
  Col_num_2=~BMP[(COL_PIXEL/8)*ROW_xPixel+1];
  Col_num_3=~BMP[(COL_PIXEL/8)*ROW_xPixel+2];
  Col_num_4=~BMP[(COL_PIXEL/8)*ROW_xPixel+3];
  Col_num_5=~BMP[(COL_PIXEL/8)*ROW_xPixel+4];
  Col_num_6=~BMP[(COL_PIXEL/8)*ROW_xPixel+5];
  Col_num_7=~BMP[(COL_PIXEL/8)*ROW_xPixel+6];
  Col_num_8=~BMP[(COL_PIXEL/8)*ROW_xPixel+7];
*/
 
  //Single color,2 bits/pixel
  Col_num_1 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2,BMP);
  Col_num_2 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+2,BMP);
  Col_num_3 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+4,BMP);
  Col_num_4 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+6,BMP);
  Col_num_5 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+8,BMP);
  Col_num_6 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+10,BMP);
  Col_num_7 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+12,BMP);
  Col_num_8 = Combine_2BitsTo1Bit((COL_PIXEL/8)*ROW_xPixel*2+14,BMP);
 
 // delayMicroseconds(1000);
 
 }
 
}

void setup()
{
 pinMode(latchPin,OUTPUT);
 pinMode(clockPin,OUTPUT);
 pinMode(dataPin,OUTPUT);
 
 pinMode(en_74138,OUTPUT);
 pinMode(la_74138,OUTPUT);
 pinMode(lb_74138,OUTPUT);
 pinMode(lc_74138,OUTPUT);
 pinMode(ld_74138,OUTPUT);
 
 
 digitalWrite(en_74138, LOW);
 
 // AVR Port Settings
 DDRD |= 0x78; //Set PIN 3 4 5 6 output  
 
 
 
 
}




void loop()
{

 
display_martix(Bmp1);

display_martix(Bmp2);




}




I wanted to display date/time and temperature (with DS3231 AT24C32 IIC module precision Real Time Clock modules and DHT22/AM2302 Digital Temperature And Humidity Sensor). No idea how. =(

Unfortunately, later found that other sellers (similar products) added library for easier operation (programming).

I was wondering if anyone has used this display similar purposes and in what way?
Any help is welcome.
Title: Re: LED DOT MATRIX 64x16
Post by: limel on Mar 01, 2014, 07:03 pm
Nobody ?
=(
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Mar 02, 2014, 12:58 pm
Hi limel,

If you do not get a response from someone who was purchased the display from another seller with better software, perhaps you should consider writing a new sketch. Experts on this forum will help if you show that you are willing to learn and do not ask for someone else to write the sketch for you.

The sketch you have been given is useful as a demonstration for how to drive the display, but not very useful for your application.

Here are my suggestions:



I hope these suggestions give you some ideas.

Paul
Title: Re: LED DOT MATRIX 64x16
Post by: limel on Mar 06, 2014, 12:18 pm
@Paul,

First of all, thanks for the reply and your suggestions.

To clarify, I'm not looking for someone else to write the sketch for me.
I'm just looking for a library which would be easier to write sketch.

For example, when I write a sketch for TFT touch dispay  I first  find an appropriate library.
Then I start writing me sketch. I never start from "zero", I'm not expert.  ;)

With the help of  uncle "Google" I finally found the appropriate library for my led dot matrix diplay !
Is a library with a few simple functions to begin with display.
So if anyone needs a library for "Driver IC : 74HC245 74HC595  74HC138 74HC04 APM4953" look here:

http://www.instructables.com/id/Pixel-Shipped-Counter/?ALLSTEPS

https://github.com/Seeed-Studio/Ultrathin_LED_Matrix
Title: Re: LED DOT MATRIX 64x16
Post by: petabyte on Apr 04, 2014, 04:05 pm
Hi limel!.
Firs of all, sorry for my English.

Could you manage the matrix with success?

Here in spain the adafruit are very expensive and i don't need colors. This matrix is ideal for me.
In your last link, i can see a better libraries with drawPoint, drawrect and drawimage functions  but the product is diferent, only 16x32 matrix. it worked  for "canton electronics" 16x64 display?
Can you scroll text?


Title: Re: LED DOT MATRIX 64x16
Post by: xmgar on Apr 09, 2014, 11:13 am
Hi limel ,

I'm also like you. Few weeks ago I bought the same led matrix display from canton-electronics. and for me it is impossible to understand the documentationI recieved.
I'm trying to make a scoreboard with that matrix display but after two weeks I'm thinking to buy another matrix display that has better library.
¿Did you get any library for that matrix?

I need help and I think you are the only one u can do it.
P.D: sorry for my english
Title: Re: LED DOT MATRIX 64x16
Post by: Gate-Keeper on Apr 13, 2014, 06:37 pm
Hi Limel

Are you able to create animation for that board? I manage to create simple sketch for the board using an in house application. But, have not yet found a way to animate the text. If you have a sample sketch that animate some text, can you please share it with us?

If anyone is interested in in the application that I am using, please let me know.

Title: Re: LED DOT MATRIX 64x16
Post by: petabyte on Apr 26, 2014, 03:39 am
Hi Gate-Keeper !

i'm trying to understand how it works, but i can't do it. The sample code is a pain, and i don't know how to paint individual pixels.
Please, your code would help me!.

Title: Re: LED DOT MATRIX 64x16
Post by: petabyte on Apr 28, 2014, 05:19 pm
i'm writting a library (or something like that) to print text in this led matrix.
I'm new in arduino, and the result won't be the best and quick code, but will work.
The "hello world" is done....when finished i'll post it here..
Title: Re: LED DOT MATRIX 64x16
Post by: xmgar on Apr 29, 2014, 11:44 am
Hi petabyte,

I' also have that matrix display but I still trying to print something. I would be gratefull to show your code.

Title: Re: LED DOT MATRIX 64x16
Post by: petabyte on Apr 29, 2014, 05:36 pm
I'll do the code a little more readable and i'll post it here this weekend, i hope.
Title: Re: LED DOT MATRIX 64x16
Post by: petabyte on May 06, 2014, 03:52 pm
here it is!.

It's not a library, and i'm new in arduino and c languaje. Therefore the code will not be the best, i'm sure, but it works and display text with diferents fonts, in the desired position.

The problem with the "canton electronic" function is that it sends to the matrix a buffer matrix with two bits per pixel and reversed bit weight. I can't understand it enough to modify it for working with a bit per pixel and non reversed bytes.
Therefore, i paint the text (and another effects) in a more confortable matrix called "canvas" with the function:

textToCanvas(unsigned char *font,int fontHeight, int fontWidth, String message, int row, int column)

only one function to all the text sizes. (only tried with 6x5, 8x8 and 16x16, could be errors with other measures).

After that, i translate the canvas to reversed doble bit with translateCanvasToBuffer(). It moves and translate the canvas to the buffer before send it to the matrix.
And finally i send the buffer to the matrix with the original "canton electronics" function. I have added two params to this function, and the setup code, moved to a function for calling it from the main ino project.

There are two versions of this  function , one for the arduino One, and another one for the arduino Mega. I only have an arduino mega, therefore i only tried the Mega version.
Despite this, you shouldn't have any problems with the UNO version. My code is equal in two cases, and i have done the same changes to the two "display_matrix" funtion versions.

I hope it works for you, and the code gives you ideas to paint another things to the matrix.

Dropbox link:

https://www.dropbox.com/l/yGdpSLWI9LWzN1RzJsoI4b? (https://www.dropbox.com/l/yGdpSLWI9LWzN1RzJsoI4b?)



Title: Re: LED DOT MATRIX 64x16
Post by: xmgar on May 06, 2014, 09:30 pm
Hi petabyte,

Your  code is very clear and it look well but I would like to know when write any word if that word can remain printed  untill I want to print other word.

Thanks for your code.
Title: Re: LED DOT MATRIX 64x16
Post by: petabyte on May 07, 2014, 12:46 pm
display_matrix(unsigned char *BMP, int delay_refresco, int sustain)

The sustain parameter is the time text will be visible in the matrix.
If you want to do another things with your code while the text is displayed......it's another question...and i think that you can't do that....

Seems that the matrix haven't persistence itself.The canton electronic function does a loop for mantain the send picture.
You could simulate it by using interrupts, or some thing like that , but the refresh will do for sure flickering problems.
I think this can be the reason for the very low price. Even so, we can buy a cheap 15$ arduino uno only to control the matrix, (sending texts from the main arduino via serial) and still get a very good total cost for a 64x16 matrix.
Now i don't need to do this, because my arduino will only display text and some draws and will not do another things, but may be an idea for you.
Title: Re: LED DOT MATRIX 64x16
Post by: xmgar on May 07, 2014, 03:16 pm
OK, I will try to creat a library to make my project.
Thanks for your code.
Title: Re: LED DOT MATRIX 64x16
Post by: kaziewip on Jul 19, 2014, 10:09 pm
I've been playing around with this display a bit and I agree that the code supplied has limited functionality.
However I've created an interrupt driven version of the code that constantly scans an 8x32 byte array to address each pixel on the board with ease.  Please use any part of this code you guys like.
Title: Re: LED DOT MATRIX 64x16
Post by: wysi on Aug 09, 2014, 02:30 pm
Hi
Thank you petabyte and kaziewip for your interesting libraries.
I have my led 64x16 dot matrix from aliexpress.com
http://www.aliexpress.com/item/Indoor-F3-75-P4-75-Single-Red-color-LED-dot-matrix-module-304-76mm-64-16/1721794648.html

Based on petabyte's code I've created an timer/interrupt based version, which runs the matrix in background. In main loop I download data from internet with an ethernetshield an update it on the matrix in fixed time intervals.

Beside the matrix display mechanisme, which could in my opinion be improved, I'm not shure, how the current-limiting could be donne right:

1. I search more data(sheets) of the matrix it selfe. (led peak current, and for how long the peak max shoud last)
2. The colum drivers (shift register 74HC595) seem not to be the right thing for their job: max 35mA current per output, total max 70mA current output for the hole IC, 0.5W max Power disipation
In multiplexing mode, there are much higher peak currents.
http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf

3. The row drivers look much more stronger: p-chanel mosfet FDS4953: 5A contiuos current, 20A peak
-> each row is only on for 1/16 time.
https://www.fairchildsemi.com/ds/FD/FDS4953.pdf

4. according to this website, i bought the matrix, it's driven 1/16 constant current. But how should the current be constant when in each row a different count of led's are shining?

5. if one led consumts 10 to 20mA in constant current, it could be peak 100 to 200mA (16x multiplex) a normal led accepts max 10x times the constant current as peak.
The whole matrix is on: 64x 100mA = 6.4A per row, always only one row on. -> 8 shift registers for the whole row: 6.4A/8 = 0.8A continous through ONE shift register. In my opinion something doesnt work right here.

Pleas correct me, if me suggestions are wrong.

conclusen: 1. the shift registers are too weak.
2. the current should be limited individually per row, according to the count of led's on in this row.


Title: Re: LED DOT MATRIX 64x16
Post by: BlackMajj on Sep 18, 2014, 11:45 pm
Hey kaziewip.
Nice code for shift registry led matrix displays. :)

I am very new to (trying to) code arduino. Just need to make a led matrix display to hang in the window of my wifes massage salon and have been searching high and low for useful sketches to "borrow" ideas from and learn how the darn language works.

Your sketch is by FAR the best one I've found.

But with my very limited knowledge of coding I have run into some problems.
The scrolling text thingie does not scroll onto the screen. The first letter magically appears in the far right part of the display but then scrolls out like it should on the left end.

Have tried to edit every variable I could think of to try to make it have a smooth scroll into the display but no such luck. :/

Could you direct me to where abouts in your code I should edit that?

And my display is 64x16 and I have no idea how to make the top half of my display useful.
I tried to switch to big font, but the top part of the font does not scroll, just the bottom part. :/

Also, if anyone can give me tips on how to edit this code so I can use both red and green (and orange) I'd appreciate it.
Oh, and anyone know if there is a possibility to dim the display? I only have 2amp psu for it, so might need to lower the intensity to stay within limits.
Title: Re: LED DOT MATRIX 64x16
Post by: kaziewip on Sep 30, 2014, 01:07 pm
Thanks for the compliments!  :)

The code I posted is for a 64x32 LED matrix display and so it doesn't surprise me that it'll misbehave on a 64x16 display.

However just after I posted the earlier code, I made some adjustments to drive a 128x16 display (two 64x16 displays connected in series).  It should work for just one 64x16 display but it'll just show LEDs addressed between 64 <= x <= 127.
(It's a bit inefficient to use this code for just one display but never mind.)

Anyhow, the 128x16 code is attached.

(BlackMajj: in answer to your specific questions, the delay(15) at the end of the code governs the scrolling timing (you'll need to fiddle with this to get the right answer for your needs) and the moveLeft(1,8,15) only scrolls lines 8 to 15 to the left.  If you want the whole thing to scroll then you'd use moveLeft(1,0,15).)
Title: Re: LED DOT MATRIX 64x16
Post by: kaziewip on Sep 30, 2014, 01:25 pm
BlackMajj:

This code in general won't work for an RG LED matrix, since the software frame buffer in my code only stores the pixels as zeros (off) and ones (on).  It would need to be adjusted to use 2 bits per pixel (0=off, 1=red, 2=green, 3=amber).

I also imagine that the electronic addressing of an RG display will also be somewhat different so the "shiftOut" routine would need to be adjusted to take care of this.

Maybe I'll get hold of an RG display and play around with it!

Using a scanning approach like the one I've pursued keeps the power requirements down as much as possible, since you're only displaying one (or two in the case of the 64x32 display) lines of LEDs at a time.  You can make the screen dimmer or brighter in software by playing with the interrupt timer variable OCR2A in the "setup" routine (the default value is 97).  Note that as it gets dimmer you'll start to see a flicker though  :(
Title: Re: LED DOT MATRIX 64x16
Post by: cuzcatleco on Oct 01, 2014, 11:14 pm
Hi Everyone ... thankz kaziewip !!

I did it !!  I tested the code for 128x64 ...and work fine for me XD !

... view a video on
https://www.youtube.com/v/__iE2CaXtKs&feature=youtu.be


Thanks Again !
Title: Re: LED DOT MATRIX 64x16
Post by: BlackMajj on Oct 03, 2014, 12:30 am
I'll try the 128x16 code in the weekend.
I suspect that one will give me less of an headache when it's just made for a "longer display".

Thanks a bunch for the tip on where in the code I can get it to scroll all the rows.
That vital info will help me a lot, so now I could probably use the 64x32 code as well. :)

Will try to fiddle with the delay(15) and see if it solves the scrolling issue I am plagued with.
On the left side when the letters scroll out everything looks right.
So a "E" for instance will on the left go from an E to three lines, then three dots and then it's gone.
On the right side it just appears as an complete E two columns from the end and starts scrolling to the left. :/
The last two columns never see any action on my display when scrolling text.  :~

But I'll see what I can figure out during the weekend. :)

As for the adressing on the red and green, it seems that it just sets either red or green pin high but the rest seems the same.
This is a code part from another sketch I found that has the green/red/orange working but no fancy scrolling and such.
Just shows clock in green and Hello in red.
Code: [Select]
  {
                  digitalWrite(greenPin,HIGH);
                  digitalWrite(oePin, HIGH);
                  digitalWrite(aPin,row & B0001 );
                  digitalWrite(bPin,row & B0010 );
                  digitalWrite(cPin,row & B0100 );
                  digitalWrite(dPin,row & B1000 );
                  digitalWrite(strPin, LOW);
                  shiftOut(redPin, sckPin, MSBFIRST, pbuffer_r[0][row]);
                  shiftOut(redPin, sckPin, MSBFIRST, pbuffer_r[1][row]);
                  shiftOut(redPin, sckPin, MSBFIRST, pbuffer_r[2][row]);
                  shiftOut(redPin, sckPin, MSBFIRST, pbuffer_r[3][row]);
                  digitalWrite(strPin, HIGH); 
                  digitalWrite(oePin, LOW);
                  delayMicroseconds(draw_delay);  // delay for seeing red
                  digitalWrite(redPin,HIGH);
                  digitalWrite(oePin, HIGH);
                  digitalWrite(strPin, LOW);
                  shiftOut(greenPin, sckPin, MSBFIRST, pbuffer_g[0][row]);
                  shiftOut(greenPin, sckPin, MSBFIRST, pbuffer_g[1][row]);
                  shiftOut(greenPin, sckPin, MSBFIRST, pbuffer_g[2][row]);
                  shiftOut(greenPin, sckPin, MSBFIRST, pbuffer_g[3][row]);
                  digitalWrite(strPin, HIGH); 
                  digitalWrite(oePin, LOW);
                  delayMicroseconds(draw_delay);  // delay for seeing green
  }

Title: Re: LED DOT MATRIX 64x16
Post by: brenryan on Jan 18, 2015, 08:56 pm
Hi,

Firstly, apologies for digging up an old thread, I thought it better than starting a new one...

I am using kaziewip's code from post #15, the countdown works great.

However, when I try to get it to display the text in const char message[] or byte buffer[256]

I can't get it to work, the best I could achieve is the message spelling out on the very last panel.


I tried PMing kaziewip to no avail, I don't think he was/is very active on these forums.



Can anybody please tell me what I need to edit/add/remove to have the display read out the message and scroll to the left?


Many Thanks,

Bren
Title: Re: LED DOT MATRIX 64x16
Post by: kaziewip on Feb 27, 2015, 03:47 pm
Bren - you're right.  I've not been around much on the forum.  Trying to work with some Uno32s.
Try my code in post number 18.  This was designed for two 64x16 panels, side by side.
Title: Re: LED DOT MATRIX 64x16
Post by: htapaha on May 29, 2015, 07:58 pm
Hello, I have recently purchased a 64x16 LED matrix, I have downloaded the zip file. And thank you guys very much!
But, I am have trouble editing the code to have text scroll the entire height of the display, I can remove the clock, the rectangle part, But I cannot seem to combine the upper and lower halves to form one display.

I am also very new to programming.

I need help please, or at least guidance into the right direction.
Thanks!!!
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on Jul 02, 2015, 01:59 am
Hello guys! I bought this matrix 16x64 here: http://pt.aliexpress.com/item/Indoor-F3-75-P4-75-Single-Red-color-LED-dot-matrix-module-304-76mm-64-16/1721794648.html

So I used this code: https://www.youtube.com/watch?v=4zE6duwytEY,

but I'm having a problem: instead of words the LEDs are off and the rest of the LEDs are lit; I would be grateful for help from someone!
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Jul 02, 2015, 08:40 am
Hi Dancopy, you seem to have posted a link to a video by mistake, instead of a link to the code. Try again.

Paul
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on Jul 22, 2015, 06:55 pm
Sorry Paul,
Here's the code that video,
thanks



Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Jul 23, 2015, 12:50 am
Try changing

Code: [Select]

      PORTB |= !((buffer[index]>>(7-i)) & 0x01) << (data_R1-8);  // top set of rows
      PORTB |= !((buffer[index+128]>>(7-i)) & 0x01) << (data_R2-8); // bottom set of rows


to

Code: [Select]

      PORTB |= !((~buffer[index]>>(7-i)) & 0x01) << (data_R1-8);  // top set of rows
      PORTB |= !((~buffer[index+128]>>(7-i)) & 0x01) << (data_R2-8); // bottom set of rows
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on Aug 03, 2015, 11:53 pm
Hello Paul! Note 10++ for you - said and done, it worked perfectly!
I do not want to bother you but I want to ask you these questions:
I have a great desire to do my own codes (sketches) but also have many difficulties in understanding; So I ask you: what is the principle for learning about the codes, especially those arrays as of this review, Led Dot Matrix 64x16 and also these RG Led Matrix?
If for their kindness and gentleness, you want to answer me, I would be very grateful!!
God bless you and all the members of this forum;
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Aug 04, 2015, 12:51 am
what is the principle for learning about the codes, especially those arrays as of this review, Led Dot Matrix 64x16 and also these RG Led Matrix?
Dancopy, I don't understand your question, can you re-phrase?
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on Aug 04, 2015, 05:49 pm
ok; sorry
How can I learn more easily on codes (sketches) of these matrices as 64x16 and 32x16 RGY?
For example, this sign (~) you told me everything has changed in the code !! how can I know this? There are good books / ebooks that explain about it?
I am very grateful to you
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Aug 04, 2015, 06:23 pm
Try this page. (https://www.arduino.cc/en/Tutorial/Foundations)
Title: Re: LED DOT MATRIX 64x16
Post by: Naudnaud on Oct 06, 2015, 10:06 am
Hello

I have buy the same 64x16 LED panel.

It's possible to make a timer min:sec;millis ?


Thank's for help me !
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Oct 06, 2015, 10:54 am
Hi Naudnaud,

Yes this is possible. You should start a new topic for this question.

Paul
Title: Re: LED DOT MATRIX 64x16
Post by: Naudnaud on Oct 06, 2015, 01:45 pm
Ok, thank's !
Title: Re: LED DOT MATRIX 64x16
Post by: Naudnaud on Oct 22, 2015, 04:24 pm
Hello


Thank's to Kaziewip for your program, it work perfectly !!


But i have a probleme with my LED Matrix.

My counter work well, but i have a lot of blinking artefact on the screen:

(http://img11.hostingpics.net/thumbs/mini_362655DSC0017.jpg) (http://www.hostingpics.net/viewer.php?id=362655DSC0017.jpg)

You know why ?
Title: Re: LED DOT MATRIX 64x16
Post by: Areeiras on Nov 25, 2015, 09:21 pm
How to rewrite the code for displaying ASCII extended characters like "É" or "ã"?

Thank You.

Title: Re: LED DOT MATRIX 64x16
Post by: jafleu on Dec 31, 2015, 02:10 am
Hi,

I'm working 117x24 led display. If anything could give any help with coding that will be great. I'm really having a hard with the coding.
for the rows i used decade counter, and shift register to drive the columns.

My question is How I modify your code to make work for a 117x24.

Plz in any way possible.

thnks in advance
Title: Re: LED DOT MATRIX 64x16
Post by: Pedro147 on Jan 01, 2016, 02:24 am
jafleu  - I would suggest that you post a clearly written question of your own in this section , rather than trying to get a response via prior threads. You may get more help. There is also Reddit Arduino (https://www.reddit.com/r/arduino/) where a lot of smart guys post. Good Luck with your project and Happy New Year
Title: Re: LED DOT MATRIX 64x16
Post by: mocart on Feb 04, 2016, 12:01 pm
Hi, may be anybody can help me. My trouble in shoing text at led matrix. It shows in inverse mode, WHITE TEXT IN RED BACKGROUND but normally must RED TEXT IN WHITE BACKGROUND, have you any ideas?

p.s. i'm using LED matrix 16x64 and arduino nano and Dancopy's shortened_Final_Code_A.ino sketch

image for example
(http://i63.tinypic.com/5es49e.jpg)
Title: Re: LED DOT MATRIX 64x16
Post by: a55830 on Feb 25, 2016, 05:55 pm
Hello


Thank's to Kaziewip for your program, it work perfectly !!


But i have a probleme with my LED Matrix.

My counter work well, but i have a lot of blinking artefact on the screen:

(http://img11.hostingpics.net/thumbs/mini_362655DSC0017.jpg) (http://www.hostingpics.net/viewer.php?id=362655DSC0017.jpg)

You know why ?
is it posible to get the code you used... please
Title: Re: LED DOT MATRIX 64x16
Post by: marcusbehrens on Mar 02, 2016, 10:05 pm
Has anyone of you tried to port this to another microcontroller? For example an ESP8266?

In this case the direct PORT handling of PORTB would not work. I'm struggling to convert the core of the code to equivalent digitalWrite operations:

      PORTB &=~(3<<(data_R1-8));                                // data_R2 is LOW; data_R1 is LOW;
      PORTB &=~(1<<(clockPin-8));                                // digitalWrite(clockPin,LOW);
      PORTB |= !((buffer[index]>>(7-i)) & 0x01) << (data_R1-8);  // top set of rows
      if (HEIGHT == 32) PORTB |= !((buffer[index+128]>>(7-i)) & 0x01) << (data_R2-8); // bottom set of rows
      PORTB |= 1<<(clockPin-8);                                  // digitalWrite(clockPin,HIGH);

I converted it to:

      byte value = buffer[index];
      digitalWrite(data_R2, LOW);
      digitalWrite(data_R1, LOW);
      digitalWrite(clockPin, LOW);
      digitalWrite(data_R1, !((value>>(7-i)) & 0x01));
      digitalWrite(clockPin, HIGH);

but it is not working. Does anyone know if a special timing is needed for this clock thing to work well and maybe an arduino direct port handling is faster or slower in the right way compared to a 32 bit microcontroller like the esp? When I added delayMicroseconds(10) in between it only got worse.

Regards, Marcus from Heidelberg
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Mar 02, 2016, 11:30 pm
but it is not working...it only got worse.
Marcus, if it was not working, how could it get worse? Such descriptions are useless to us, we cannot see what you can see. You must describe what happens precicely, or we won't  be able to help.

The esp outputs are 3.3V. Does the display require 5V signals?

Perhaps you should try your digitalWrite() code on a 5V Arduino. This will slow down the refreshing of the display and make it flicker, but at least you can test your converted code before you try it on the esp.

Paul
Title: Re: LED DOT MATRIX 64x16
Post by: macsoft on Mar 08, 2016, 03:21 am
Hi! this is exactly what I'm looking for.
I'm trying to do a GPRS data GET, and then print on the matrix.. but since I need VOID LOOP for each one.. it does not work.
Can you share your code please?
thanks

Hi
Thank you petabyte and kaziewip for your interesting libraries.
I have my led 64x16 dot matrix from aliexpress.com
http://www.aliexpress.com/item/Indoor-F3-75-P4-75-Single-Red-color-LED-dot-matrix-module-304-76mm-64-16/1721794648.html

Based on petabyte's code I've created an timer/interrupt based version, which runs the matrix in background. In main loop I download data from internet with an ethernetshield an update it on the matrix in fixed time intervals.

Beside the matrix display mechanisme, which could in my opinion be improved, I'm not shure, how the current-limiting could be donne right:

1. I search more data(sheets) of the matrix it selfe. (led peak current, and for how long the peak max shoud last)
2. The colum drivers (shift register 74HC595) seem not to be the right thing for their job: max 35mA current per output, total max 70mA current output for the hole IC, 0.5W max Power disipation
In multiplexing mode, there are much higher peak currents.
http://www.nxp.com/documents/data_sheet/74HC_HCT595.pdf

3. The row drivers look much more stronger: p-chanel mosfet FDS4953: 5A contiuos current, 20A peak
-> each row is only on for 1/16 time.
https://www.fairchildsemi.com/ds/FD/FDS4953.pdf

4. according to this website, i bought the matrix, it's driven 1/16 constant current. But how should the current be constant when in each row a different count of led's are shining?

5. if one led consumts 10 to 20mA in constant current, it could be peak 100 to 200mA (16x multiplex) a normal led accepts max 10x times the constant current as peak.
The whole matrix is on: 64x 100mA = 6.4A per row, always only one row on. -> 8 shift registers for the whole row: 6.4A/8 = 0.8A continous through ONE shift register. In my opinion something doesnt work right here.

Pleas correct me, if me suggestions are wrong.

conclusen: 1. the shift registers are too weak.
2. the current should be limited individually per row, according to the count of led's on in this row.



Title: Re: LED DOT MATRIX 64x16
Post by: Error_400 on May 01, 2016, 12:01 pm
Hello!

Does anybody have the functional program for Arduino MEGA created by Petabyte in post #11?
(http://forum.arduino.cc/index.php?topic=222334.msg1711189#msg1711189 (http://forum.arduino.cc/index.php?topic=222334.msg1711189#msg1711189))

That dropbox file is gone and all other programs are only for Arduino UNO which does nothing on MEGA. There is 2 fails I can see by quick look (#include <pgmspace.h> and const byte data_R2=11;) but I can' find any good solution to make it work.

I'm able to run "rotation" in canton-electronics but it's incredibly slow (0,3s for one scroll) and I can't do any other code in main loop because the display turns off on that other tasks.

;tldr: Is there any solution how to make that UNO program work on MEGA?

EDIT: I did it. Key is correct pin names. For details just take both files and compare them (and remove <Arduino.h> from Eclipse
So, for search engines: 64x16 led matrix display for Arduino Mega 2560
Title: Re: LED DOT MATRIX 64x16
Post by: 49thdiver on May 11, 2016, 07:13 pm
Hi everyone, I have just acquired one of these displays and am using Kaziewicz/canton-electonics code as a starting point for a message board. I have it working but am struggling to understand how the code works. I am stuck on trying to get the full two rows to display the text. I understand that you fill the reserved memory and then the interrupt routine pushes the memory map out to the display. The difficulty I am having is when I add "font = 2" on  line 256 only the top 8 pixels of the 16 pixel high text is displayed on the lower row and nothing is displayed on the top row.

You help appreciated, code attached.
Title: Re: LED DOT MATRIX 64x16
Post by: macsoft on May 11, 2016, 07:35 pm
on the line:  drawChar(120,8,message[count%(sizeof(message)-1)],0,false);
Play with the second number "8". use only 0,8,16,32... That is in what Y line you want the text to appear.
Title: Re: LED DOT MATRIX 64x16
Post by: 49thdiver on May 11, 2016, 08:29 pm
Fantastic, just the tip I needed, changing the line as you suggest caused some activity in the right most cell, but it did not scroll. Following this tip lead me to change :

moveLeft(1,0,15);        // column spacing,starting row,?

I changed the 2nd parameter from 8 to 0 to correspond to the change  on the drawchar as you suggested.
It now works beautifully.

Thank You !!

Now on to the next challenge to control the display to display and hold individual lines of text according to an external stimulation ( a push button) and a line break character as the delimiter in the text. Perhaps a comma or other character delimited.
Title: Re: LED DOT MATRIX 32x32
Post by: samsul_arifin on May 13, 2016, 04:57 am
good morning master ...
Can you help me?
how to connect to a 32x32 LED PANEL P10 with 1 control arduino arduino?
Title: Re: LED DOT MATRIX 64x16
Post by: Ulissesgrz on Aug 23, 2016, 07:26 am
Any solution to add emoticons? Regards
Title: Re: LED DOT MATRIX 64x16
Post by: GioraPen on Sep 04, 2016, 10:18 am
Hello everyone,

I have few questions:

1) How to extend the ASCII table to other languages? I don't understand how to translate between the ASCII tables I find on the internet, and the one that appears in the nice code sketch of Kaziewicz and others.

2) How can I simplify the code of Kaziewicz, or complicate the code of cannon to display a constant message, without "running text". I mean that I like the option of just entering the message in the code and it appears "right away".

* Many thanks to all the members of the forum. I don't know would I do without the nice code pieces I find here.
Title: Re: LED DOT MATRIX 64x16
Post by: GioraPen on Sep 05, 2016, 02:36 pm
Ok,
I have partially answered my questions, and want to share with you my findings which I've summarized in the attached pdf, for good Karma:)


"How to control 16x64 led matrix by Arduino code (pixel by pixel) using provided canon code as a starting point". See pdf
Title: Re: LED DOT MATRIX 64x16
Post by: Sunspot on Sep 09, 2016, 06:55 pm
With the help of all here I have managed to drive the 64x16 display by WIFI from a serial string in a terminal in a Linux box (Raspberry Pi) or Mac OSX.
The Arduino receives serial data and displays 8 characters on the top half as a static display and then a string that scrolls along the bottom half.
This can be fed from a serial program but I now use and ESP8266 to receive the data by WIFI from a box on my LAN.

This is very crude since I program by copy - paste - pray. (Thanks!)

EDIT - now multimode
Two lines of fixed 8x8 characters
Top line of fixed 8x8 characters - bottom line scrolling
One line of scrolling 16x8 characters
One line of fixed 16x8 characters

Download from here http://www.sunspot.co.uk/Projects/displays/LEDmatrix16x64/LEDmatrix16x64.html (http://www.sunspot.co.uk/Projects/displays/LEDmatrix16x64/LEDmatrix16x64.html)

I hope to add a graph using the draw rectangle code.

Title: Re: LED DOT MATRIX 64x16
Post by: Sunspot on Sep 12, 2016, 09:35 pm
I wonder if there is any way to reduce the screen brightness for night use?
I see nothing in the code about changing the pulse width.

If you improve my "lesson one" code (link above) please comment here.
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Sep 13, 2016, 08:18 am
I wonder if there is any way to reduce the screen brightness for night use?
Yes, that should be perfectly possible by controlling the % of time that the ENable pin is high.
Title: Re: LED DOT MATRIX 64x16
Post by: Sunspot on Sep 14, 2016, 09:42 pm
Glad you think it possible - thanks - but interrupt timers are new to me....
I see lines like digitalWrite(en_74138, HIGH); but see no obvious delay statement before a digitalWrite(en_74138, LOW);
I am wondering if the prescaler is the variable to modify?

I aim to have the Arduino read a pot on the analog pin then change the brightness - or perhaps use an ambient light detector.

These display are very good value and almost do the job.

However I have recently noticed these -
http://www.ebay.co.uk/itm/272157054443?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

which are RGB and about the same cost per pixel as the red one we are playing with-
http://www.ebay.co.uk/itm/381417128291?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

And I think they can run the Adafruit sketches judging by the pictures the advert displays

(paste the URL please the edit keeps failing)
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Sep 15, 2016, 04:30 pm
http://www.ebay.co.uk/itm/272157054443?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT (http://www.ebay.co.uk/itm/272157054443?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT)

http://www.ebay.co.uk/itm/381417128291?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT (http://www.ebay.co.uk/itm/381417128291?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT)

Pasting links seems to be working fine for me, and I'm using an android phone! So please try harder.

To dim your display, there will have to be some significant code changes. Currently, the interrupt occurs one per scan row. To dim, two interrupts per scan row will be needed. One to send out the new data and switch on the display, and the second to simply switch off the display. The gap between these two interrupts will determine the brightness. If the gap is short, the display will be dim. If it is almost the full length of the scan period, the display will be bright.

Your code is not easy to read. It's not indented and the lines wrap, so it looks a mess. But even so, something about it seems odd to me. I don't understand what pin R2 is for, and I wonder if it is in fact not needed for your display. Maybe your code was written for a bi-colour display?



Title: Re: LED DOT MATRIX 64x16
Post by: Sunspot on Sep 15, 2016, 09:08 pm
The code by Phil Kaziewicz was posted earlier on this thread - I added the serial input.
Perhaps he should try harder.
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Sep 16, 2016, 08:13 am
Oh yes, he gave the sketch in this (http://forum.arduino.cc/index.php?topic=222334.msg1810754#msg1810754) post. It is formatted, perhaps you lost it when you copy+pasted it. You just need to use AutoFormat from the Tools menu.

His code has a comment at the top which says it drives a 64x32 display, twice the size of yours. That explains what the R2 pin is for: he other half of a larger display.

When I said "try harder", I was just referring to posting links.
Title: Re: LED DOT MATRIX 64x16
Post by: other_format on Feb 09, 2017, 01:31 pm
I'm having a nightmare with these boards. I've got two boards linked together and using the code for the 128x16 matrix posted earlier in this thread. Issue I'm having is that setting inverse to either true or false has the reverse effect for each board. So if I set inverse to 'false' board one will be black text on red background while board two will have red text on black background.

SO my question is - is it possible to switch the boolean statement for inverse after the last column on the first board (columns 0 - 64 inverse true / columns 65 - 128 inverse false) so that both boards will display the same? If so can anyone give me any advice as to which part of the code I should look at. I'm happy to tinker with it, not expecting anyone to do it for me, just need some help getting started.

Many thanks!
Title: Re: LED DOT MATRIX 64x16
Post by: BramVibe on Mar 16, 2017, 06:59 am
Hello,
Im using this panel, 64x16 with promini+hc05 to change the character displayed.
How can i extend it to 128x16?
Thanks
Title: Re: LED DOT MATRIX 64x16
Post by: BramVibe on Apr 01, 2017, 05:54 pm
Somehow just figure it out for 128x16.
Here's the video.. thankyou..

https://youtu.be/8kLitvf3KfE

https://youtu.be/z-gLVKAcIGQ
Title: Re: LED DOT MATRIX 64x16
Post by: Igor64 on Apr 09, 2017, 08:05 pm
Salve a tutti,

Cosa bisogna modificare al codice 128x16 per far funzionare tre display 64x16 collegate in serie.

Chiedo aiuto

kaziewip mi può dare qualche suggerimento?
Title: Re: LED DOT MATRIX 64x16
Post by: ingaguirrel on May 21, 2017, 09:06 am
Hi , I made it!

Thanks to this tutorial, it works perfectly: http://www.sunspot.co.uk/Projects/displays/LEDmatrix16x64/LEDmatrix16x64.html (http://www.sunspot.co.uk/Projects/displays/LEDmatrix16x64/LEDmatrix16x64.html)

(http://i.imgur.com/DtNWdq1.jpg)
(http://i.imgur.com/P9YgtJE.jpg)

I also made a custom case with acrylic.

Thank you for the help
Title: Re: LED DOT MATRIX 64x16
Post by: manshuriyusuf on Jul 14, 2017, 02:54 am
I've been playing around with this display a bit and I agree that the code supplied has limited functionality.
However I've created an interrupt driven version of the code that constantly scans an 8x32 byte array to address each pixel on the board with ease.  Please use any part of this code you guys like.
Thanks, it's work using Arduino Uno, but can't work using Arduino Mega. Can help me?
Title: Re: LED DOT MATRIX 64x16
Post by: nadaanas1988 on Aug 29, 2017, 03:31 pm
Hi limel

I want to ask you where I have to change to make this code for 128X16 display

your reply will be highly appreciated.

Thank you
Nada
Title: Re: LED DOT MATRIX 64x16
Post by: umeshwalkar on Dec 17, 2017, 11:59 am
Hello everyone,

i tried Kaziewicz code in the post #18 for 128x16. it works well. many thanks to him.
but can anyone guide me how to drive more LEDs. where in the code i need to make changes to make it work for 192x16 or 256x16... changing #define COLUMN to 24 and increasing buffer[384] size is not working.

also i noticed that while scrolling the texts, it characters looks like shaking. i can noticed the scanning of rows from 0 to 15. how can i avoid it to smooth scrolling.

thanks.



Title: Re: LED DOT MATRIX 64x16
Post by: gourish on Feb 17, 2018, 05:58 am
hello everyone

This code help[ed me lot, i completed almost everything what i needed top do with 128*16 using this code.

i have only one issue,if i try to display this data with such long spaces half the data is not printing at all.

Quote
Global                                     variables                           use                       1589              bytes (77%) of dynamic memory, leaving 459 bytes for local variables. Maximum is 2048 bytes.
plz can anyone help me with this?
Title: Re: LED DOT MATRIX 64x16
Post by: Darshit115 on Feb 17, 2018, 11:54 am
Hi EveryOne

Many Many thanks to Kaziewicz code of 128x16. it works perfect for me.

Can anyone help me to drive more LEDs in series. can anyone suggest me or guide me to what change in code that make it work for 192x16 or 256x16.

please help.
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on May 07, 2018, 11:33 pm
Hi Kaziewicz! Taking advantage of the subject, this code: https://pastebin.com/MjPD047h in PASTEBIN it is certainly yours, but you are calling this library: sriftas.h; where to find it?
Another thing: does this code refer to a clock? Does it work on Arduino 1.8.5? Thanks
Title: Re: LED DOT MATRIX 64x16
Post by: Fran6 on Sep 27, 2018, 12:47 am
Please how much current does the module draw?
Can it be powered with rechargeable li-ion batteries?
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Sep 27, 2018, 07:28 am
I don't know the current draw, I don't have a module to measure, but I would estimate between 1.3A and 2.6A. Yes, it could be powered by Li-ion batteries. If a Tesla Model X can be powered by Li-ion batteries, then so can this display. The question really is would a step-up voltage converter be needed. The size/capacity of the batteries would depend on how long you need the display to run between charges.
Title: Re: LED DOT MATRIX 64x16
Post by: gunaone on Oct 08, 2018, 04:04 pm
i get hard to displaying "string" n "int"..

Code: [Select]

// Author: Phil Kaziewicz 19th July 2014
// 64x32 LED display matrix test code
// based upon original code from canton-electonics
// Arduino 1.0.5 UNO R3
#include <avr/pgmspace.h>

#define COLUMNS 16

#define HEIGHT 32

// Connections to board
const byte latchPin = 8;
const byte clockPin = 12;
const byte data_R1 = 11;
const byte data_R2 = 10;
const byte en_74138 = 2;
const byte la_74138 = 3;
const byte lb_74138 = 4;
const byte lc_74138 = 5;
const byte ld_74138 = 6;
byte ScanRow = 0;
unsigned long counter;

const char message[] = " DISPLAY  Characters  TWO ROWS    ";


  pinMode(en_74138, OUTPUT);
  pinMode(la_74138, OUTPUT);  pinMode(lb_74138, OUTPUT);
  pinMode(lc_74138, OUTPUT);  pinMode(ld_74138, OUTPUT);

  digitalWrite(en_74138, LOW);
  digitalWrite(data_R1, HIGH); digitalWrite(data_R2, HIGH);
  counter = millis();
  sei(); //allow interrupts
};

// Note that there's no need to do anything with the screen in the main loop.
// Whatever's in "buffer" is constantly scanned out.
void loop() {
  unsigned long clock;
  static int count = 0;
  byte seconds, colour;

  clock = 100000000 - ((millis() - counter) / 1000);
  // display clock
  //drawChar(0,0,(clock/10000000)%10,0,false);
  //drawChar(8,0,(clock/1000000)%10,0,false);
  //drawChar(16,0,(clock/100000)%10,0,false);
  //drawChar(24,0,',',0,false);
  //drawChar(32,0,(clock/10000)%10,0,false);
  //drawChar(40,0,(clock/1000)%10,0,false);
  //drawChar(48,0,(clock/100)%10,0,false);
  //drawChar(56,0,(clock/10)%10,0,false);

  // seconds = (clock/10)%10;
  // colour = (clock/200)&1;

  // draw a rectangle
  // drawRect(72+seconds*5,0,72+seconds*5+3,7,colour);
  // drawRect(72+seconds*5+1,2,72+seconds*5+3,3,!colour);

  // draw a blob
  // setPixel(80,6,colour); setPixel(126,6,colour); setPixel(127,6,colour);
  // setPixel(126,5,colour); setPixel(126,7,colour);

  // display next character of message
  drawChar(120, 1, message[count % (sizeof(message) - 1)], 1, false);

  count = (count + 1);
  // DISPLAY SCROLL Rate set at delay
  // move the text 7 pixels (not 8 because it looks better) to the left
  for (byte i = 0; i < 10; i++) { // character spacing
    delay(50);              // delay between scrolls
    moveLeft(1, 2, 15);      // column spacing,?,?
  };
};


any idea....
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Oct 08, 2018, 09:03 pm
Quote
any idea....
No, sorry, you must be much more detailed and specific in your question. I would guess you have some problem converting int to string. There are several ways to achieve this but without context I do not know which way to recommend. Which line of your sketch?

Quote
I get hard to...
Please be careful with your English. I am certain you did not intended it, but you were close to "obscene" language there which could cause offence.
Title: Re: LED DOT MATRIX 64x16
Post by: AkisKoza on Dec 06, 2018, 01:20 am
Hi mocart! Sorry, after all this time, have you solved your problem?
I have the same problem.

any ideas?
Title: Re: LED DOT MATRIX 64x16
Post by: gunaone on Dec 11, 2018, 10:25 am
is there someone who has succeeded in performing the split function........
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on Jan 03, 2019, 12:41 am
Greetings everyone!
I have an arduino sketch: "64x32 LED display matrix test code" which is possibly from Phil Kaziewicz (at least it's in the code header) and is calling a library (#include "sriftas.h";) but I do not I can find nowhere; could someone or the author himself share the link from that library? I would be very grateful
The sketch link is this: https://pastebin.com/MjPD047h
Title: Re: LED DOT MATRIX 64x16
Post by: Combed on Jan 04, 2019, 04:07 am
Greetings everyone!
I have an arduino sketch: "64x32 LED display matrix test code" which is possibly from Phil Kaziewicz (at least it's in the code header) and is calling a library (#include "sriftas.h";) but I do not I can find nowhere; could someone or the author himself share the link from that library? I would be very grateful
The sketch link is this: https://pastebin.com/MjPD047h
just delete #include "sriftas.h" and add font data (font8x16_basic[] & font8x16_basic[]) to the sketch, done compiliing and work as well for me. thanks for all
Title: Re: LED DOT MATRIX 64x16
Post by: Combed on Jan 04, 2019, 04:22 am
so ive made a void to draw some words easily,

just call it by

Code: [Select]

drawText(0, 8, "test");


Code: [Select]

void drawText (int x, int y, const String text)
{
  int start;
  int len = text.length();
  char buf[len + 1];
  text.toCharArray(buf, len + 1);
  while (len > 0) {
    drawChar(x, y, buf[start], 2, false);
    start ++;
    x += 8;
    if (start >= len)
    {
      x = 0;
      break;
    }
  }
}
Title: Re: LED DOT MATRIX 64x16
Post by: PaulRB on Jan 04, 2019, 10:48 am
ive made a void
Good work, but its not called a "void". Its called a function. The function's return type is void (meaning it has no return value).
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on Jan 04, 2019, 04:37 pm
just delete #include "sriftas.h" and add font data (font8x16_basic[] & font8x16_basic[]) to the sketch, done compiliing and work as well for me. thanks for all
Hi Combed! Thanks for the answer. I have no idea where to add the lines you said; could you please send me the sketch link you have (with those lines added)? Thank you very much!
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on Jan 04, 2019, 09:04 pm
just delete #include "sriftas.h" and add font data (font8x16_basic[] & font8x16_basic[]) to the sketch, done compiliing and work as well for me. thanks for all
I again Combed!
I did the procedure you told me (I think I did right) but it is showing the following error:

Arduino: 1.8.5 (Windows 10), Card: "Arduino / Genuine One"

50: 53: fatal error: twi.h: No such file or directory C: \ Users \ Daniel \ Documents \ Arduino \ libraries \ Wire \ Wire.cpp

  #include "twi.h" // i2c software bit-bang emulation
                                                      ^
compilation terminated.

exit status 1
Compiling Error for Arduino / Genuine One Card

I think it's in relation to the Wire library but, I've used others as well.

And replacing the Wire library with another, (from PaulStoffregen) shows this:

Arduino: 1.8.5 (Windows 10), Card: "Arduino / Genuine One"

Compilation options changed, recompiling all
D: \ Arduino \ LEDs Matrix 16x64 \ 16x64_Led_Matrix_Clock_DS1307 (Jan.2019) \ 16x64_Led_Matrix_Clock_DS1307_without_sriftas \ 16x64_Led_Matrix_Clock_DS1307_without_sriftas.ino: In function 'void drawDigital (uint16_t, uint16_t, uint8_t)':

16x64_Led_Matrix_Clock_DS1307_without_sriftas: 365: Error: 'digitals' was not declared in this scope

      const uint8_t * pSrc = digitals + n * 16;
                            ^
exit status 1
'digitals' was not declared in this scope

Hugs from Daniel Fernandes
Title: Re: LED DOT MATRIX 64x16
Post by: Combed on Jan 05, 2019, 12:54 am
Good work, but its not called a "void". Its called a function. The function's return type is void (meaning it has no return value).
that what i mean :), iam beginner for this, I'ill improve my word in the next post thanks for the correction
Title: Re: LED DOT MATRIX 64x16
Post by: Combed on Jan 05, 2019, 01:04 am
Hi Combed! Thanks for the answer. I have no idea where to add the lines you said; could you please send me the sketch link you have (with those lines added)? Thank you very much!
you're welcome, just download and tell me if it works


I again Combed!
I did the procedure you told me (I think I did right) but it is showing the following error:

Arduino: 1.8.5 (Windows 10), Card: "Arduino / Genuine One"

50: 53: fatal error: twi.h: No such file or directory C: \ Users \ Daniel \ Documents \ Arduino \ libraries \ Wire \ Wire.cpp

  #include "twi.h" // i2c software bit-bang emulation
                                                      ^
compilation terminated.

exit status 1
Compiling Error for Arduino / Genuine One Card

I think it's in relation to the Wire library but, I've used others as well.

And replacing the Wire library with another, (from PaulStoffregen) shows this:

Arduino: 1.8.5 (Windows 10), Card: "Arduino / Genuine One"

Compilation options changed, recompiling all
D: \ Arduino \ LEDs Matrix 16x64 \ 16x64_Led_Matrix_Clock_DS1307 (Jan.2019) \ 16x64_Led_Matrix_Clock_DS1307_without_sriftas \ 16x64_Led_Matrix_Clock_DS1307_without_sriftas.ino: In function 'void drawDigital (uint16_t, uint16_t, uint8_t)':

16x64_Led_Matrix_Clock_DS1307_without_sriftas: 365: Error: 'digitals' was not declared in this scope

      const uint8_t * pSrc = digitals + n * 16;
                            ^
exit status 1
'digitals' was not declared in this scope

Hugs from Daniel Fernandes
i dont know what is your problem exactly, i think you should re install your arduino, or do you use portable arduino ide?
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on Jan 05, 2019, 03:50 pm
Hi Combed! Thanks for sending me your sketch; very cool, worked but for me, with some very noticeable Flicker.
Another friendly thing: It's difficult (for me it is) to add the colon between the hours and the minutes and between the minutes and the seconds, as here: http://www.stm32duino.com/viewtopic.php?t=542
Thanks again
Title: Re: LED DOT MATRIX 64x16
Post by: Combed on Jan 08, 2019, 05:19 am
Hi Combed! Thanks for sending me your sketch; very cool, worked but for me, with some very noticeable Flicker.
Another friendly thing: It's difficult (for me it is) to add the colon between the hours and the minutes and between the minutes and the seconds, as here: http://www.stm32duino.com/viewtopic.php?t=542
Thanks again
can you give me some picture how flicker looks like, maybe i can help you. i think the problem is the value "prescaler" that you use.
have you connected EN pin form panel to pin 2 arduino ?

this is my code to show digital clock, hours minutes seconds included. you can use it for your reference.
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on Jan 09, 2019, 05:18 pm
Excellent Combed!!! Your 'drawText' sketch now works perfectly for me with the pins:

// Connections to board
const byte latchPin = 8;
const byte clockPin = 12;
const byte data_R1 = 10; // I changed from 11 to 10
const byte data_R2 = 11; // I changed from 10 to 11
const byte en_74138 = 2;
const byte la_74138 = 3;
const byte lb_74138 = 4;
const byte lc_74138 = 5;
const byte ld_74138 = 6;

Thank you very much ++
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on Feb 10, 2019, 01:03 am
I'll try the 128x16 code in the weekend.
I suspect that one will give me less of an headache when it's just made for a "longer display".

Thanks a bunch for the tip on where in the code I can get it to scroll all the rows.
That vital info will help me a lot, so now I could probably use the 64x32 code as well. :)

Will try to fiddle with the delay(15) and see if it solves the scrolling issue I am plagued with.
On the left side when the letters scroll out everything looks right.
So a "E" for instance will on the left go from an E to three lines, then three dots and then it's gone.
On the right side it just appears as an complete E two columns from the end and starts scrolling to the left. :/
The last two columns never see any action on my display when scrolling text.  :~

But I'll see what I can figure out during the weekend. :)

As for the adressing on the red and green, it seems that it just sets either red or green pin high but the rest seems the same.
This is a code part from another sketch I found that has the green/red/orange working but no fancy scrolling and such.
Just shows clock in green and Hello in red.
Code: [Select]
  {
                  digitalWrite(greenPin,HIGH);
                  digitalWrite(oePin, HIGH);
                  digitalWrite(aPin,row & B0001 );
                  digitalWrite(bPin,row & B0010 );
                  digitalWrite(cPin,row & B0100 );
                  digitalWrite(dPin,row & B1000 );
                  digitalWrite(strPin, LOW);
                  shiftOut(redPin, sckPin, MSBFIRST, pbuffer_r[0][row]);
                  shiftOut(redPin, sckPin, MSBFIRST, pbuffer_r[1][row]);
                  shiftOut(redPin, sckPin, MSBFIRST, pbuffer_r[2][row]);
                  shiftOut(redPin, sckPin, MSBFIRST, pbuffer_r[3][row]);
                  digitalWrite(strPin, HIGH); 
                  digitalWrite(oePin, LOW);
                  delayMicroseconds(draw_delay);  // delay for seeing red
                  digitalWrite(redPin,HIGH);
                  digitalWrite(oePin, HIGH);
                  digitalWrite(strPin, LOW);
                  shiftOut(greenPin, sckPin, MSBFIRST, pbuffer_g[0][row]);
                  shiftOut(greenPin, sckPin, MSBFIRST, pbuffer_g[1][row]);
                  shiftOut(greenPin, sckPin, MSBFIRST, pbuffer_g[2][row]);
                  shiftOut(greenPin, sckPin, MSBFIRST, pbuffer_g[3][row]);
                  digitalWrite(strPin, HIGH); 
                  digitalWrite(oePin, LOW);
                  delayMicroseconds(draw_delay);  // delay for seeing green
  }


Hi BlackMajj
Do you have the complete sketch for this Dot MATRIX 64x32 Bicolor LED? If so, could you put it here?
Thank you
Title: Re: LED DOT MATRIX 64x16
Post by: MASUMcma on Apr 13, 2019, 08:53 am
Dear members,
May I display more than 8 independent character in 64x16 dot matrix statically, not animated ?
Title: Re: LED DOT MATRIX 64x16
Post by: Dancopy on May 26, 2019, 12:33 am
Greetings to all!
I am not a programmer, I am far from it, but I am simply an admirer, especially of these colored LED panels and, I would like your opinion on which LED array module should I buy, to do, among other things, a Clock and/or Static or Dynamic Scrolling Text, in two lines or not, considering the ease of finding Arduino sketches for this.
These are two preferred options:

1) https://pt.aliexpress.com/item/32977781030.html?spm=a2g0o.cart.99999999.258.17053c00AzXLXx (https://pt.aliexpress.com/item/32977781030.html?spm=a2g0o.cart.99999999.258.17053c00AzXLXx)

2) https://www.ebay.com/itm/LED-Lattice-Module-16x24-Dot-Matrix-LED-Subtitle-Text-Display-Program-3-3V-5V/372659863414 (https://www.ebay.com/itm/LED-Lattice-Module-16x24-Dot-Matrix-LED-Subtitle-Text-Display-Program-3-3V-5V/372659863414)

Option (1) would be a two-color panel (64x16), and option (2) would be two panels (16x24 x2 = 16x48), considering its smaller size;
In short, what better panel, if I may say so?
Thanks to anyone who can help me.
Title: Re: LED DOT MATRIX 64x16
Post by: taipscode on Jun 14, 2019, 02:21 am
 Hello everybody.

i don't know how to use array pointer ,can you help me !

i downloaded shortened_Final_Code_A.ino , it works good .
But i don't understand these code ,can you explan for me .
Thankyou

for (byte i=0; i<fontrows; i++) {
       *pDst = *pSrc;     // populate the destination byte
       pDst += 8;         // go to next row on buffer
       pSrc++;            // go to next set of 8 pixels in character
   }

-------------------------------------



and full codes:
// Arduino 1.0.5 UNO R3


// Connections to board
const byte latchPin=8;
const byte clockPin=12;
const byte data_R1=10;
const byte data_R2=11;
const byte en_74138=2;
const byte la_74138=3;
const byte lb_74138=4;
const byte lc_74138=5;
const byte ld_74138=6;
byte ScanRow = 0;
unsigned long counter;

//Insert message here ("message ")
const char message[] = "Tustin High School T-Tech Academy     ";



// Routine to print a single character in one of 8 columns
// Inputs:
// x is one of (0,16,24,32,40,48,56),
// y (0 to 16 or 24 depending upon font size),
// n is either (0 to 9) or an ascii value,
// font=0 for big font, 2 for small font,
// inverse is true for an inverted character
void drawChar(uint16_t x, uint16_t y, byte n, byte font, boolean inverse) {
   byte charbytes[16], fontrows, xover8 = x>>3;
   int index;
   if (0 != (x % 8)) return;    // x not a multiple of 8
   if ((n>9) && (n<32)) return; // invalid character
   if (font==0) fontrows=16; else fontrows=8;
   if ((n>=0) && (n<=9)) index=(n+16)*fontrows; else index=(n-32)*fontrows; // go to the right code for this character

// addressing start at buffer and add y (rows) * (WIDTH is 64 so WIDTH/8) is 8 plus (x / 8) is 0 to 7
   byte *pDst = buffer + (y << 3) + xover8;
   for (byte i=0;i<fontrows;i++) {  // fill up the charbytes array with the right bits
     if (font==0) charbytes = pgm_read_byte(&(font8x16_basic[index+i]));
     // reverse bit order for fonts 0 and 1
     if (font != 0) {
       charbytes = (charbytes & 0xF0) >> 4 | (charbytes & 0x0F) << 4;
       charbytes = (charbytes & 0xCC) >> 2 | (charbytes & 0x33) << 2;
       charbytes = (charbytes & 0xAA) >> 1 | (charbytes & 0x55) << 1;
     };
     if (inverse) charbytes = ~charbytes;
     };
   const byte *pSrc = charbytes; // point at the first set of 8 pixels    
   for (byte i=0; i<fontrows; i++) {
       *pDst = *pSrc;     // populate the destination byte
       pDst += 8;         // go to next row on buffer
       pSrc++;            // go to next set of 8 pixels in character
   }
};

void moveLeft(byte pixels, byte rowstart, byte rowstop) { // routine to move certain rows on the screen "pixels" pixels to the left
byte row, column;
short unsigned int address;
 for (column=0;column<8;column++) {
   for (row=rowstart;row<rowstop;row++) {
     address = (row<<3) + column; /// right here!
     if (column==7)
        buffer[address] = buffer[address]<<pixels; // shuffle pixels left on last column and fill with a blank
       else {                // shuffle pixels left and add leftmost pixels from next column
        byte incomingchar = buffer[address+1];
        buffer[address] = buffer[address]<<pixels;
        for (byte x=0;x<pixels;x++) { buffer[address] += ((incomingchar & (128>>x)) >> (7-x))<<(pixels-x-1); };
        }
    }
 }
};



void shiftOut(byte row) { // fast routine to shove out 8 columns into two rows via board's shift registers
 for(byte column=0;column<8;column++) {
   byte index = column + (row<<3);  
   for(byte i=0;i<8;i++) {    
     PORTB &=~(3<<(data_R1-8));                                 // data_R2 is LOW; data_R1 is LOW;
     PORTB &=~(1<<(clockPin-8));                                // digitalWrite(clockPin,LOW);
     PORTB |= !((buffer[index]>>(7-i)) & 0x01) << (data_R1-8);  // top set of rows
     PORTB |= !((buffer[index+128]>>(7-i)) & 0x01) << (data_R2-8); // bottom set of rows
     PORTB |= 1<<(clockPin-8);                                  // digitalWrite(clockPin,HIGH);
   };
 };
};

ISR(TIMER2_COMPA_vect){  
    cli();
    digitalWrite(en_74138, HIGH);     // Turn off display
    shiftOut(ScanRow);                // Shift out 8 columns
    digitalWrite(latchPin, LOW);
    digitalWrite(latchPin, HIGH);
    PORTD = (ScanRow << 3) | (PORTD & 0X87); // Highlight row: pins 3 4 5 6 (la_74138 lb_74138 lc_74138 ld_74138)
    digitalWrite(en_74138, LOW);     // Turn on display
    ScanRow++;                       // Do the next pair of rows next time this routine is called
    if (ScanRow==16) ScanRow=0;
    sei();
};

void setup() {

// Set up Timer2 as the scanning interrupt timer
 cli(); // clear interrupts
 TCCR2A = 0; TCCR2B = 0; TCNT2  = 0;
 TCCR2B |= (1 << CS12) | (1 << CS10);     // Set 1024 prescaler
              // 160Hz scan rate = 10 frames/second (16 pairs of rows)
 OCR2A = 97;  // 97 = (16,000,000 / (1024*160)) - 1
 TCCR2A |= (1 << WGM21); TIMSK2 |= (1 << OCIE2A);
 
 pinMode(latchPin,OUTPUT);  pinMode(clockPin,OUTPUT);
 pinMode(data_R1,OUTPUT);   pinMode(data_R2,OUTPUT);
   
 pinMode(en_74138,OUTPUT);
 pinMode(la_74138,OUTPUT);  pinMode(lb_74138,OUTPUT);
 pinMode(lc_74138,OUTPUT);  pinMode(ld_74138,OUTPUT);
 
 digitalWrite(en_74138, LOW);
 digitalWrite(data_R1, HIGH); digitalWrite(data_R2, HIGH);
 counter = millis();
 sei(); //allow interrupts
};

void loop() {  
static int count=0;




   
// display next character of message
   drawChar(56,16,message[count%(sizeof(message)-1)],0,false);
   count = (count + 1);
   // move the text 7 pixels (not 8 because it looks better) to the left
   for (byte i=0; i<4; i++) {
      delay(80);
      moveLeft(2,1,32);
   };
};