LCD_screen Library Suite

Jump to the new LCD_screen Library Suite!

Please find the new LCD_screen Library Suite that replaces the Serial_LCD Library Suite.

The LCD_screen Library Suite supports a wider range of SPI and 16-parallel affordable screens, apart from the 4D Systems Picaso-based serial screens.

Enjoy :slight_smile:


Bonsoir,

Please find a first release of an Arduino library for the amazing 4D LABS ?LCD-32PT(SGC) 3.2” Serial LCD Display Module.

To draw a triangle, instead of sending that ASCII string

  • G 0, 200, 0, 160, 0, 160, 0, 80, 100, 60, 0xff, 0xff
    use plain
  • myLCD.triangle(200, 160, 160, 80, 100, 60, 0xffff)

:wink:

Thanks avenue, I've just got two of these displays so will keep an eye on this library.

Funnily enough one of the things I want to display is direction and roll/pitch and that's basically what your demo shows.


Rob

Cool, yet another library for one of the 4d systems screens. I made one myself for the uOled serial screens (Goldelox controller). Maybe we, lib. writers for 4d systems screens, should get together and try to come up with a 'general' library. Maybe a couple as there are a few different controllers used in the various screens.

I have implemented most of the commands including text, graphics, 5 switches, sd-card access and sound output.

Jeroen.
Active on irq daily.

Bonsoir Jeroen,

Yes, it seems a nice idea.

Before starting this project, I did some search on the 4D libraries. Those I've found dealt with screen smaller than 256 pixels.

Main difference is the 320x240 screen requires words and not bytes for coding the coordinates.

So we should consider how to write a "one for all" library!

Best regards,

I won't be ready to use my displays for a while but am interested in any library you guys do and will be able to contribute when I get my hardware up and running.


Rob

Hi avenue33, Graynomad,

If you (or anyone) are interested in my lib., let me know and i will mail it. You are right that most libs are for the smaller sized displays. Maybe we could use at least the same syntax for the basic commands.

I have rewritten 'my' lib. a few times for learning and i decided on a 'base' class/lib with only the commands from the command sheet, tried to follow their syntax/wording/behavior as close as possible. I planned on extending functionality in separate classes and/or headers. Thus far i have, apart from most of the basic commands, made a (proof of concept) class for bargraphs and another one for histograms. One of the things i would like to add is a filesystem class for using the sd-card with the FAT filesystem instead of 'raw' access.

As i started with an Arduino Mega1280 i made the base class accept any of the hardware serial ports as a constructor argument. Another thing i would like to implement is incorporating the softSerial library to free the single hardware serial port on the Arduino UNO or duemilanove type Arduinos. I chose to incorporate the serial communications inside the library to be able to optimize the communications in the future. (dreaming about custom buffer sizes, non blocking commands and so on. :slight_smile: )

It seems the 4d-systems modules are becoming popular. I like them apart from the price. Also i think the shield they have is a bit limited. No circuit for buttons or sound, only hardware serial port usage.

Regards,
Jeroen.

Yotson on irc://freenode/arduino

I plan to use this display with a Mega1284 chip on a control node for a network I'm developing, (http://busnet.robgray.com/hardware/ncn/index.php), I got some free hardware from 4DS to help me do the job so I better get something made I guess :slight_smile:

I have so much to do on the network design that there's not much point getting too involved with the display right now but I'm happy to look at code, maybe I'll spot a bug or two or have an opinion on the API calls.

I have one question (to both avenue and yot), do you handle landscape and portrait orientations? Presumably it's just a matter of sending the appropriate command to the display then keeping two variables for width and height.

My email is rob@robgray.com if anyone wants to contact me directly.


Rob

Graynomad:
I have one question (to both avenue and yot), do you handle landscape and portrait orientations?

The orientation is handled manually through the

  byte setOrientation(byte b);   // Display Control Functions – 59hex

instruction on my library.

How do you guys like this screen? How does it compare to the iPhone's screen? How usable is it in direct sunlight?

midnight_coder:
How do you guys like this screen?

Colours are crisp, the screen is fast, the touch is accurate, and the price is ok.

How does it compare to the iPhone's screen?

Don't dream to much: they aren't playing on the same field.

How usable is it in direct sunlight?

I haven't tested yet.

@avenue
I grabbed the code form your site and am having a look.

IIRC there's no way to dim the backlight, is that the case?


Rob

Graynomad:
IIRC there's no way to dim the backlight, is that the case?

Sure, it is.

It's already implemented. See :astonished:

byte Serial_LCD::setContrast(byte b);

Please refer to the .h file :slight_smile:

OK I see that, I guess that is affectively the same thing, especially if they implement the contrast adjust by dimming the back light which they may do.


Rob

Hi!

Here's the 2nd release of the library which includes bug fixes (font size), and enhancements (touch).

A new library called button provides the basics for buttons management. It works hand-in-hand with the Serial_LCD library.

Enjoy :slight_smile:

Lookin' good, I'm still nowhere near using my displays yet but am paying attention :slight_smile:


Rob

Nice, I wish I had seen this before I wrote my own library, although I needed the goldelox SGC command set.

I did implement all of the SD card functions in the 4D command reference (my thread is at the bottom of the first page ATM) but I didn't really find anything unusual about them compared with any of the rest of the commands. The only one that needed any special handling was ReadSector, for which I found I needed to increase the Rx buffer to be much larger or else I would lose 75% of the block (which in turn would cause my version of nacAck() to lock forever, so I added a simple timeout to prevent the worst case).

@extent,

Thank you for sharing!

I haven't investigate the SD card functions yet, so I'll pick them from you library :slight_smile:

@all,

Here's the link to the thread about extent's 4D library.

Main difference lies on the 2-byte coordinates for the 320x240 screen versus 1-byte coordinates for the smaller than 255 pixel screens.

Ya SGC commands for both generations of chips are identical in almost every case. The other one that I remember that's different are some of the control flags, like the goldelox does not support the landscape setting.

Hi!

Here's a real model where the touch-screen acts as a dashboard to manage the stepper motor. The model combines an Arduino board and fischertechnik building blocks.

For more details, please read

On the Arduino side, an I2C stepper controller.

On the fischertechnik side, a stepper motor model.

Enjoy :slight_smile:

I noticed in the example file that you draw your own buttons using your button.h/button.cpp. Was just wondering why you chose to do it that way instead of using the button drawing commands built into the 4D Serial language?