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.
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.
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. )
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.
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
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.
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.
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).
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.
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.
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?