Arduino Forum

Forum 2005-2010 (read only) => Software => Development => Topic started by: doc_norway on May 08, 2010, 02:30 am

Title: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on May 08, 2010, 02:30 am
Hello.

I have made a library for RGB GLCD's based on the LDS183 controller.
This is the display that is used on the RGB LCD Shield by NKC Electronics.

You can download the library from my website: http://www.henningkarlsen.com/electronics/a_l_rgb_glcd.php

Please bear in mind that this is my first go at making a library for the Arduino, so it might not be as good as it can be.

Any feedback would be appreciated.

Regards
Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: PaulS on May 08, 2010, 04:08 am
How about a link to the display that the library is for. I'm lazy.
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: nkcelectronics on May 08, 2010, 05:00 am
The display is featured in the RGB LCD shield for Arduino http://www.nkcelectronics.com/rgb-lcd-shield-for-arduino-65k-color-k65.html

but can be purchased alone: http://www.nkcelectronics.com/rgb-lcd-65k-color-module-philips-pcf8833-comp658833.html

It is PCF8833 compatible, similar to the one sold by Sparkfun but with 65K colors!

I uploaded a video (running doc_norway's library) and embedded it in the product page.
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: garry572 on May 11, 2010, 12:18 pm
Hi
Great library works well with the RGB LCD shield
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on May 12, 2010, 10:55 pm
Just a quick update: v1.2 is now released with two new functions.

/Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on May 13, 2010, 02:59 pm
Another quick update: v1.3 is released with support for Arduino Mega.

/Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: lildobe on Aug 20, 2010, 11:12 am
Nice library,i wanted to ask,is there any pre-function to read pixel,whether on o not?and any pre-function to fill an area and not only the circle or rettangle but an area... :-[
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on Aug 20, 2010, 01:44 pm
Hi Dobe

As far as I know there is way to read the state of a pixel.

The only way I can think of to make a flood-fill function is to keep a "screen-buffer" in memory, but as the buffer alone would require 32KB of ram this is not an option.

/Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on Oct 14, 2010, 10:10 pm
RGB_GLCD v1.4 is released.



/Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: scoobydrvr on Nov 18, 2010, 04:29 am
Does this make use of all the analog pins? I'd like to use this for a project, but I need to make use of at least 2 analog pins and all of the other GLDs use 5 of the 6 available.
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on Nov 18, 2010, 08:36 am
@scoobydrvr

The shield uses Digital 2-6, so all the analog pins are free for you to use :)

/Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: scoobydrvr on Nov 18, 2010, 05:27 pm
That's great! Less pins than any of the others I've seen; I'm getting one!
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on Nov 24, 2010, 01:34 pm
RGB_GLCD v1.5 is released.



/Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: jffordem on Jan 10, 2011, 11:05 pm
I just got mine working. (The fine soldering work was almost too much for me.)  Yay!

I'd like to download your library, but don't have an RAR extractor.  Can you publish a ZIP as well?

Also, do you have plans to implement a Netduino library for this shield too?

Thanks!

Jim
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on Jan 10, 2011, 11:12 pm
Rar usually get better compression, but if you PM me with your email-address or send me a message through my contact-form, I will email a zip-file to you.

I havent got a Netduino, so dont hold your breath. Maybe you would like to donate one... :)

/Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: lorenjz on Jan 14, 2011, 03:45 am
I just got an arduino (My first one so bear with me as I am new to this) and the LDS183.  With your code I've gotten it going with very little trouble.  Thank you for that!

I do have a couple of questions though

First when I display white text on a black background there appears to be white vertical lines  through the text 1 pixel wide (like the pipe charecter "|") at a couple of places making the text harder to read.  Is there a way to eliminate those lines?

Second, is there a way to make the text bigger?  If I need to I'm happy to do some reading or coding.  I just don't have a clue where to look.

Thanks again,

Loren
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on Jan 14, 2011, 12:54 pm
@Loren:

Can you post an image of the vertical bars, or post / send me your sketch?

It is possible to get bigger text, but it will involve a rather large modification to the code. You can take a look at my ITDB02_Graph libraries for ideas on how to do it. They both support small and large font.

/Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: lorenjz on Jan 14, 2011, 02:03 pm
Thanks For your help!

Here are a couple pictures:

(http://lh3.ggpht.com/_l6STa_DQw_s/TTBEy-uLkCI/AAAAAAAAAEE/KjWlXzDNV9o/s912/2011-01-14_07-37-14_896.jpg)

(http://lh5.ggpht.com/_l6STa_DQw_s/TTBI9Djom5I/AAAAAAAAAEY/2Pbnet4_u7Q/s912/2011-01-14_08-00-02_927.jpg)


And here is the code:

Code: [Select]
// RGB_GLCD_Bitmap (C)2010 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program is a demo of the drawBitmap()-function.
//

#include "RGB_GLCD.h"
#include <avr/pgmspace.h>

GLCD myGLCD;

extern unsigned int icon1[0x400];
extern unsigned int icon2[0x400];
extern unsigned int tux[0x1000];

void setup()
{
 myGLCD.initLCD();
 //myGLCD.clrScr();
       myGLCD.fillScr(255,255,255);
 //myGLCD.setColor(255,255,255);
 myGLCD.print("Hello World Init",CENTER,5,255,255,255);


 // Draw a moving sinewave
 
  byte buf[126];
 int x, x2;
 int y, y2;
 int r;
 x=1;
 for (int i=1; i<3654; i++)
 {
   x++;
   if (x==127)
     x=1;
   if (i>127)
   {
     if ((x==63)||(buf[x-1]==63))
       myGLCD.setColor(0,0,255);
     else
       myGLCD.setColor(255,255,255);
     myGLCD.drawPixel(x,buf[x-1]);
   }
   myGLCD.setColor(0,255,255);
   y=63+(sin(((i*1.3)*3.14)/180)*50);
   myGLCD.drawPixel(x,y);
   buf[x-1]=y;
//    delay(3);
 }
 delay(5000);
 myGLCD.clrScr();
 myGLCD.fillScr(255,255,255);
}

void loop()
{
myGLCD.setColor(0,0,0);
 myGLCD.print("Blinking Message", CENTER,5,255,255,255);
   myGLCD.print("Line 2 stuff", CENTER,15,255,255,255);
 
delay(1000);
myGLCD.setColor(255,255,255);
myGLCD.print("Blinking Message", CENTER,5,0,0,0);
myGLCD.setColor(0,0,0);
myGLCD.print("Line 2 stuff", CENTER,15,255,255,255);
delay(1000);
 myGLCD.setColor(0,0,0);
myGLCD.print("Blinking Message", CENTER,5,255,255,255);
myGLCD.setColor(255,255,255);
myGLCD.print("Line 2 stuff", CENTER,15,0,0,0);
delay(1000);

}


I have downloaded the graph code and will try and figure out the Large Font stuff.  

Thank you again for your help.

Loren
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on Jan 14, 2011, 02:14 pm
I'll look into the problem, but it might take a couple of days...

/Hennning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: lorenjz on Jan 14, 2011, 09:27 pm
Quote
I'll look into the problem, but it might take a couple of days...

/Hennning


Thank you very much...Take your time!
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on Jan 16, 2011, 12:53 pm
RGB_GLCD v1.6 has been released



Any further updates to the library will only be announced on my website: http://www.henningkarlsen.com/electronics/
All site news is available as a RSS-feed.

@Loren: This new version should solve your problem with vertical lines :)

/Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: moutonnoir on Jan 19, 2011, 11:00 pm
Henning,

I just started using your library. It looks very nice. There are some things I like about it - mainly the fairly full featured print implementation. I have also been using a (expensive) 4D board, and the available libraries are a mess compared to your's. The 4D board with it's onboard processor and memory card is pretty fast.

I want faster screen redraw with bitmaps, as the current speed is just not useful for my application. :D

I see you have put in the basic commands to deal with using the PCF8833 RAM. I am hoping the RAM would allow for faster screen drawing. I want to put an SPI EEPROM with images on the SPI with the display and load the images at startup.

You are clearly fairly experienced with this display, and I was wondering if you have any advice on this task?


Thank you!

Robert
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on Jan 20, 2011, 04:21 pm
Quote
You are clearly fairly experienced with this display, and I was wondering if you have any advice on this task?


I am sorry, but I can help you there. The main problem as I see is not the speed of the display, but the speed which the ATmega can push data to the display.

/Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: moutonnoir on Jan 20, 2011, 07:24 pm
Doc Henning,

I do realize the arduino is the bottle neck. My plan was a 'Loading' splash screen with a little progress bar. Like video games. (I am making a game, in fact).

I want a few sprites, icons, and images in the RAM at program start.. Probably about 80k.. I will be putting the images into a I2C Serial 128K or 256K EEPROM (24LC128\256) - then using the Arduino to read from EEPROM to display RAM.

I am gonna make it work.. I think the process is:

1)Load appropriate data from EEPROM into a byte array
2)Send RAM Access X\Y command to display
3) Send data from byte array to display RAM
4)Cancel RAM writing by sending any other command
5)To restore from RAM, use the 'read sector\column' code.

I will be working on it. I am not that good at writing communication routines with all of the bytes, timing, and bits and whatnot - but I can usually make things work when i want them to.

Thank you for the library! It is awesome.

Robert
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: moutonnoir on Jan 20, 2011, 07:53 pm
Uh Ohhhhh..

Let me ask: Is there even RAM available on the display for what I am describing, or is this 209K just the 132x132x12bit 'Screen RAM'  which displays immediately when filled?

What is the major bottle neck? I do not need scolling sprites or animation or anything - but i do want to be able to display full screen images without having to watch them draw. I also want to be able to make menus using my web design techniques - which requires a few images in memory at once - or loading to memory much faster.


Is the bottleneck the SPI interface? Is it 8 or 9-bit? Is the 9-bit only for displays 132x132, not 128x128? Are you using bit banging or library SPI commands? Is SPI the major bottleneck because of throughput potential - or just implementation? Are there any first places you would look to get some speed increases? Would parallel mode be faster?

I am going to upload some videos and link them - of my menu system as it is implemented on a 4D systems board. I really do not like the 4D systems stuff that much though - and want to use your library.

finally, do you know about any other displays? What about using this display in an actual manufacturing project? I am working towards manufacturing something with an LCD, and currently these Phillips screens are the cheapest option I have found.
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: doc_norway on Jan 21, 2011, 11:23 am
I am sorry, but I cant help you. I am not an expert on these displays.

My library is based on the demo-code provided by NKC Electronics, so you might be better off asking them these questions.

Please keep in mind that this was also my first Arduino "project" ever, so I basically made it to learn more about the Arduino, and its environment.

/Henning
Title: Re: New library: RGB GLCD (LDS183 Controller)
Post by: rmm200 on Jan 23, 2011, 02:24 am
Thanks so much for doing this library - it works great!

I did get hung up on the print function not allowing String, so I added an overload:

void GLCD::print(String st, byte x, byte y, byte r, byte g, byte b)
{
 int stl, i;
 
 stl = st.length();
 if (x==RIGHT)
       x=128-(stl*6);
 if (x==CENTER)
       x=(128-(stl*6))/2;
 
 for (i=0; i<stl; i++)
   printChar(st.charAt(i), x + (i*6), y, r, g, b);
}

If this is useful to anyone, just add this after the print definition in the library code - and add a corresponding header line.

Robert