Graphic display

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Graphic display

Post by medelec35 »

Thanks for the gLDC update.
It does fix the simulation, but the problems I was describing are with the actual hardware, and update does not fix that. For instance I have updated colour numbers to orange (see my above post)
To my surprise using the paint package the font within my simulation does indeed change to orange. However all the display on my hardware still stays black. Background is OK as that’s yellow.
orange text  & Red numbers1.jpg
orange text & Red numbers1.jpg (107.69 KiB) Viewed 7053 times
So I can see the wording and the number counting.
But the other difference is the yellow box that erases the counting number has a black border on my hardware, but border is invisible on the simulation which is what I’m after.
As stated previously I am new to using gLCD, so could be my error?
Would someone mind checking my flowchart please and be able to state if it’s a bug or my fault the hardware is still different after gLCD component update.
Thank you for your time.

Edit: Also after the gLCD the hardware still does not work. It still does this:
medelec35 wrote:The flowcharts pasted on this thread e.gTachometer_V3.fcf (thanks for sharing Jan) just produce a solid light blue box covering 100% of the background. Then over the top of light blue background a large black solid square box is drawn covering 99.7 of the light blue, and and writing that's underneath.
But the simulation does now work.
Attachments
Orange Text & Red Count Example.fcf
(8 KiB) Downloaded 367 times
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Graphic display

Post by Benj »

Hello Medelec,

Right I know why this problem is happening.

The old gLCD C file used to take the colour data, do a bit of checking and then pass it straight into the gLCD. This meant you had to know what bit depth each of the colour variable had to be for each display.

I have changed the code for the v4.5 release so that the expected colour is now in the range from 0 - 255. The functions now convert this value to the correct bit depth for the display your using making the colour fit in correctly with an RGB format and allowing maximum colour scaling. Therefor the colours in the simulation might not tie up correctly but this was the case anyway once we started adding extra displays.

For the EB058 board the bit depths for the displays are 5-bit for G and B and 6-bit for R.

e.g.
Red = Red >> 2;
Green = Green >> 3;
Blue = Blue >> 3;

So the values you are passing are all ending up as 0's to the display which is why you are getting black text etc.

For anyone needing a v4.5 gLCD component that uses the legacy colour system let me know and I will post up the component C file.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Graphic display

Post by medelec35 »

Thanks Ben.
FANTASTIC! Your spot on!
If I now enter the exact numbers that paint package produces e.g Red 249, Green 149 and Blue 32
The colours match spot on! i.e Now got an orange display.
Perhaps that makes a good tip for including within the help file?
Talking of help file, the reason I was using 0 – 7 is because that that the help shows in the latest Flowcode update.
Using 0 - 255 for colours.jpg
Using 0 - 255 for colours.jpg (66.9 KiB) Viewed 7048 times
Just a minor thing, now using 0 – 255 the simulator now shows incorrect colours.
But as I know in advance what numbers to used, I’m not bothered by simulation colour differences at all.

I agree with John and others.
Thank you,Ben, the reset of Matrix and beta testers for making the 4.5 update possible
Martin

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times

Re: Graphic display

Post by Zane »

Hi Ben,

Thanks for your reply. I have looked at the explaination you have given me, of the new colour format, i was unaware of but is a great idea. However the problem i have also is that nothing displays correctly on the screen. This also includes on the simulator within flowcode. I have down loaded the flowcode example posted that displays the text "matrixmultimedia" and then prints a number. I have attached a screen shot of what i get in flowcode on the screen from the simulator "1.jpeg". I have also got a small flowchart that prints some text at 50,50 on the display. It places the text at 50 on the y axis but at 0 on the x axis. It also draws a box at 70,70 and ends at 80,80. However only a small is drawn on the left side of the screen. "2.jpeg" shows what the simulator in flowcode displays on the screen. I have also attached a copy of the flowchart the provides the results in "2.jpeg". Any help is most appreciated.

Regards

Zane
Attachments
Test.fcf
(7.5 KiB) Downloaded 370 times
2.jpg
2.jpg (6.46 KiB) Viewed 7033 times
1.jpg
1.jpg (7.57 KiB) Viewed 7033 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Graphic display

Post by medelec35 »

Hi Zane,
There is a simple fix for that.
See: http://www.matrixmultimedia.com/mmforum ... =29&t=8700
save PIC_gLCD.c update
There is information where to place the file.
That will solve the simulation issue.
I have found another good tip:
Again with windows 7 If you load paint (just click the windows icon bottom left,then type paint)
Once paint is loaded, click the down arrow (to the left of home tab)
Click properties and change both sets of pixels to 128
When placing a box You will need to select the box then select the size, and choose the thinnest line
Now if you place text, box, line or anything else within the window, when you hover over the object
the coordinates thats required for the gLCD component are given at the bottom left of the paint program.
GFX Text +Box.jpg
GFX Text +Box.jpg (17.95 KiB) Viewed 7030 times
Colour values.jpg
Colour values.jpg (122.4 KiB) Viewed 7030 times
Only tried this with gLCD EB057 selected.
Regards

Martin
Attachments
Test2.fcf
(6.5 KiB) Downloaded 365 times
Martin

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Has thanked: 93 times
Been thanked: 76 times

Re: Graphic display

Post by Zane »

Hi Martin,

I have tried this and it works, thankyou. I will try it in hardware later on today.

Regards

Zane

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: Graphic display

Post by medelec35 »

Zane wrote:Hi Martin,

I have tried this and it works, thankyou. I will try it in hardware later on today.

Regards

Zane
Your welcome.
I was just supprised that software free with windows works so well with gLCD module.

It make it a lot easier.
Another tip:
Within paint, if you click on the 'Select' down arrow (Home Tab) and select Transparent selection, then you can select and drag objects around without affecting objects already placed.


Martin
Martin

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times

Re: Graphic display

Post by JohnCrow »

Thanks

This will save time planning a layout for a project I have in mind
1 in 10 people understand binary, the other one doesn't !

Post Reply