Due GUI (Graphical user interface) - [now community project]

Bug latest: (not yet release though)

  • FIXED: Popup keyboard debounce added and working.
  • On occasion screen goes haywire when analogue clock drawn (sure this is due to trying to clear old hand pos when there isn't one so looking up a ridiculous value in the cosine/sine table - off to work now so will fix later!)
  • Spurious values from calibration screen sometimes appear on the main menu (again I can fix this in a few minutes but no time now).

Hopefully release bug fix later and then onto slider or calibration object.....

Bug latest:

  • FIXED: Popup keyboard debounce added and working.
  • FIXED: On occasion screen goes haywire when analogue clock drawn.
  • FIXED: Spurious values from calibration screen sometimes appear on the main menu.

Changes:

  • ADDITION: showCalibration() - This shows the calibration screen with no further code with a new "SAVE" button which will soon write the calibration data to a special data sector within the EEPROM of the screen.
  • CHANGE: Addition of two new functions HandleShowButtons(int URN) & HandleShowLoopStuff() - these functions pass control to the library during the loop function and button handler allowing the library to create it's own objects and handle them.
  • CHANGE: Removal of the calibration screen code from the demo program and switch to using the showCalibration() function which does the same thing.

version 0.12 uploaded.

Already some bits towards 1.13 but I'm going off on a tangent at the moment as I work out how to do SDcard image file to LCD, copy flash to SDcard and vice versa.......

Oh and if anyone is using the CTE shield with a Mac I've converted their Windows only image uploader to MacOS using wine :smiley:

Version 1.13 news....

I will upload over the next few days but added:

GhostButton

Basically this is an area of the screen which acts as a button. This can be used for detecting if someone has touched part of the screen so you could draw a menu and store it as a graphic then update the whole screen with this graphic and then use this button to detect the user pressing parts of it.

ImageButton

This takes 1, 2 or 3 images.... image, pressed image and alternative image

If image only is used then it displays that image and if it is clicked it registers
If pressed image is set then when the image is pressed it changes to the pressed image momentarily to signify being pressed
If alternative image is set then the image changes between image and alternative image acting like a checkbox.

Version 1.13 further news....

Cycle button now has it's first option (bit 1)

if set then you can cycle in either direction by pressing first half of button or second half of button (by setting increment - or + you can alter whether 1st half is up/down with 2nd half always opposite).

AND now

(bit 2)

if set then it does the same for top/bottom half of button

Version 0.13 now uploaded with much better manual (still needs lots of work but the objects are all listed).

Addition of new objects:

The cycle button is supplemented with a cycleTEXTbutton which allows you to use an array of Strings as the list of options to select! You can also change the array once the object is drawn!

New ImageButton which allows lots of options of how it works:

  1. Just as an image that can do something when clicked
  2. As an image that changes momentarily when you click it and you can do something when clicked
  3. As an image that changes momentarily then switches to an alternative image and vice versa allowing a boolean on/off which works automatically
  4. As above without the momentary alternative image.

Now I've got the hang of recording the array's pointer so as to use the user's own array of strings I will be using this technique to produce a "menu" object, "list box" object and maybe a few more.

cowasaki:

Michael__MA:
Hi and Many thanks for your extensive efforts -

is there any downloadable form or repository where i can download the files for testing and verifying - would be great as you really hit the spot by combining the essential libs to one Gui tooolbox
i'm thinking about an Dali based lighting control with an Due and 5" touch display which i will put on the playgroud once i have everything put together - your toolbox would be very helpfull for this project.

Kind regards, Mike

I have got checkboxs and a variant of them called cycleboxs working. I am just working on an input box for text and will then release a downloadable version for testing whilst I finish the other planned bits.I have a demo running here that has three pages and allows people to switch between them and keep the variables consistent etc. The input box effectively scrolls up the part of the screen with the input and creates a keyboard across the bottom half of the screen so quite a bit of work... I will also be adding the option of PS2 and bluetooth keyboard support etc but that is for later.......

Now After returning from my trip i've downloaded and tested the UTFT lib with my CTE shield and 5"display - all demos were running without prob - then i dwonloaded and installed the DueGui 013 files and tested them -but did not succeed so far - assuming there is some missconfiguration from my side the question is, where do i have to change the physical wire definition for the display and the touch ..

on the UTFT 2.41 and CTE combination i had to change the following:
1.uncomment "#define CTE_DUE_SHIELD 1" in the HW_ARM_defines.h in the \hardware\arm folder of the UTFT library
2.Change the pinout to : UTFT myGLCD(CTE50,25,26,27,28);
and
UTouch myTouch(76,5,74,75,2);

to make the touch interface and display working - but where do i have to change this in the DueGUI - i didn't had the time to look throuch all the files to find it myself - so if someone has an idea, i'd really preciate some help.

kind regards, Mike

I'm not in front of my computer at the moment but in the demo there is a line which initialises everything, something like initGui or something like that. I'll have a look tomorrow and give you a definite answer.

Ok...

Here we go.....

at the start we have:

#include <DUEGUI.h>
DUEGUI DueGUI(CTE70); // which is: DUEGUI TFT1(CTE70,25,26,27,28);

Where we setup which screen and if necessary alternative pin outs.....

Then inside the SETUP function we have:

DueGUI.InitGUI(6,5,32,3,2,52,2,51);

Where we setup the pin-outs for the touch, SDcard and eeprom

void InitGUI(byte tclk, byte tcs, byte tdin, byte dout, byte irq,int CS_pin, int Rate,int SD_pin);

Hi,
I am trying to get this library to work with the Itead Studio ITDB02-5.0. Should I have to make a lot of changes or is there just some pin configs that I am getting wrong?

Hi All.

I just received my 5.00" CTE LCD and a CTE Due shield.. Loaded version 0.13 of the great Due GUI and ran the example demo 02...looks great..one problem was that there was no touch response....bummer...want I found was that touch was working but the Y axis was inverted!

Hmm.... checked the jumpers on the shield and they looked OK, at least from what I could find on the CTE website...so I poked around in the source for Due Gui and found there is a function for both X and y axis reversing....

I added this-- DueGUI.setReverseY(true) to setup:

 // Initialise DueGUI
  DueGUI.InitGUI(6,5,32,3,2,52,2,51);
  DueGUI.setReverseY(true);

Works now..

Can't wait until this is complete it is really very nicely done. I have written a fairly complicated (graphically) 4 screen GUI using the original work by Mr. Karlsen for the Uno32 by Chipkit...sorry Arduino , but I needed the speed for the screen redraws!..

Feature Request:

Add the ability to define line width in DrawLine.. I need fatter lines! It can be done by drawing offset multiple lines but, that's a pain....

thanks for all your hard work!

David Garrison
Gaithersburg, MD USA

Yes you can reverse the X and Y axis just in case the touch screen is upside down :slight_smile:

I've been away from this project for a short while as I have had other things that need doing. Hopefully will get back to it soon as I am using this as the basis for a new dash I am building for my car :smiley:

After some testing, i discovered the screen is jittering - swapped out the shield and LCD without success - are there similar experience out here ?
It seems the screen is redrawn without sync or buffering.

Kind regards, Mike

This is an example of a call on the current version of the library:

Code:

DueGUI.addPanel(0,0,799,50,clrBlue,clrWhite,clrWhite,2,"Board control menu",280,8,BVS_34,visible,URNnull); /* URNnull!!!!!???? */

The final attribute "URNnull" was added but it was working for hours after being added....

In DUEGUI example, there are an error:

"extern uint8_t SmallFont[];
#include "SPI.h"
#include <UTFT.h>
UTFT TFT1(CTE70,25,26,27,28); "

Correct form:

"extern uint8_t SmallFont[];
#include "SPI.h"
#include <UTFT.h>
DUEGUI TFT1(CTE70,25,26,27,28); "

¿ Somebody can help me ?
I'm new to arduino and I a little lost.

Thanks!!!

What is the error that you get?
The URNnull means that the object has no Unique Reference Number assigned to it and you cannot refer to it later. You will use a URN if you need to make reference to the object later in your code. URNnull should not give an error. The URN is defined at the top of the file. It is just an int number.

The error are in that prototipe include.h refer addPanel with n arguments, but when call function in demo example, pass n+1 arguments and go to error.

The example that there are in webpage of Due GUI driver don't compile correctly for me.

I'm a new user of Arduino, but in the past,I used ATmel and Microchip, and GCC compiler.

I think that there are an error, but I'm not sure if I unknow this platform.

Please, somebody can send DUE Gui library old to my email ? thanks a lot txpto@hotmail.com

Bye

Well, I think that I have a solution.

In DUEGUI ZIP (v0.13), there are two sample files:

DueGUI_demo.ino that no work correctly (+1 argument extra in prototipe function .h) and

and DUEGUI DueGUI(CTE70);   // which is: DUEGUI TFT1(CTE70,25,26,27,28);

in incorrect form.

But inside ZIP file, there are other example DueGUI_demo2.ino that works ok.

I don't know why this two example files, one works and other don't work. but I'm compiled second file and 0 errors have done.

Thanks

I am happy that you got it working. The first demo that you tried was for an older release. I think it was just not removed or updated. Anyway, you found the right stuff.

wow, great work, i came across this, and it is exactly what i need for the project i am currently planning. now no need to have a web-based user interface for settings, i will use a full touch screen driven user settings interface :grin: