Using GLCDs, Good or bad idea??

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
407charles
Posts: 122
Joined: Thu Jun 26, 2014 12:01 pm
Has thanked: 41 times
Been thanked: 19 times
Contact:

Using GLCDs, Good or bad idea??

Post by 407charles »

Every time data is updated on a display is necessary to clear the whole thing? I just keep writing over the last data! Is this normal? there is something I missing? Also there is any possibility to "print ASCII"? In order to get data organized in a control sometimes is necessary to name it, for example, building a recipe or a block of data (a file), but how this can be done on a display? Please is somebody can clear this doubts I will appreciate it. Thanks a lot for your time and help.
Last edited by 407charles on Mon Jan 04, 2016 9:13 pm, edited 1 time in total.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Using GLCDs, Good or bad idea!!

Post by kersing »

Graphic displays add pixels only, they do not clear previous contents. To clear a region, draw a rectangle in the background color.

I don't understand the last part of your question. Could you rephrase it?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

407charles
Posts: 122
Joined: Thu Jun 26, 2014 12:01 pm
Has thanked: 41 times
Been thanked: 19 times
Contact:

Re: Using GLCDs, Good or bad idea??

Post by 407charles »

Ok, for example, I'm using a GLCD to show temperature and humidity values from a room. every time the data changes the number update but rewrites over the last data. The 20x4 LCD display doesn't do that, only if it goes from a let's say a two digit number to a three digit and comes back to two, the third more significant digit stays in the display unless you clear that line. In the GLCD it just write over the last data and it looks scrambled. My question is, does it any other function more than clear display to just delete the data before updating to the new data number without deleting the whole screen? For some people is annoying watching a display that flashes continuously. It will look more professional if any other screen data that is not being updated remains on the screen and only the one is updating is cleared before writing it to the screen. Therefore, I would like to know if there is something else that I can do to accomplished this task. Can this be done using draw a rectangle macro? Would you please show me how? I upload my program and if you could add a modification on it I will understand how is this use effectively, just if you have the time. Thanks a lot for your help.
Attachments
Mega_DSS1289.fcfx
(8.77 KiB) Downloaded 247 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Using GLCDs, Good or bad idea??

Post by kersing »

Try the attached code.
Attachments
Mega_DSS1289.fcfx
(9.89 KiB) Downloaded 246 times
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

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: Using GLCDs, Good or bad idea??

Post by Benj »

It should simply be a case of setting the transparent parameter to 0 whenever you print text or a number, this should allow the data to be displayed without being garbled.

The transparent option is there to allow you to create text with a drop shadow effect but is only really useful on colour displays where you can alter the font colour to distinguish between the shadow and the text.

407charles
Posts: 122
Joined: Thu Jun 26, 2014 12:01 pm
Has thanked: 41 times
Been thanked: 19 times
Contact:

Re: Using GLCDs, Good or bad idea??

Post by 407charles »

It does work perfect! Question, how do you know what combination of colors where needed to create the desire effect? you got 0x57, 0xff and 0xc0 the first macro "set color to background color" and the second macro "restore foreground color" 0x80, 0x00, 0xff. I tried that yesterday, I was able to draw the rectangle in the desire place but it never work as yours because I did not set this two macros and I only have the display data enclose on a rectangle and it did not work as a data delete function. I appreciate your time and support on my project. If you can explain how did you determine the right combination of colors I will greatly appreciate that, so in further projects I will be able to applied the learned task. Thanks a lot again.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Using GLCDs, Good or bad idea??

Post by kersing »

If you look at the properties of the gLCD you'll see the colours listed in Blue Green Red format. Everything else is just reading the documentation and a few simulation runs.
colour-dialog.png
(122.14 KiB) Downloaded 5211 times
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

407charles
Posts: 122
Joined: Thu Jun 26, 2014 12:01 pm
Has thanked: 41 times
Been thanked: 19 times
Contact:

Re: Using GLCDs, Good or bad idea??

Post by 407charles »

I got it, thanks a lot for your help and support. Do you have any idea if ASCII characters can be displayed on GLCD displays? I would like to know. Thanks a lot again and happy new year. Cheers!

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Using GLCDs, Good or bad idea??

Post by kersing »

You are already displaying numbers and letters, so yes, ASCII characters can be displayed. I suspect you mean something else, please clarify what you want to happen exactly.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

407charles
Posts: 122
Joined: Thu Jun 26, 2014 12:01 pm
Has thanked: 41 times
Been thanked: 19 times
Contact:

Re: Using GLCDs, Good or bad idea??

Post by 407charles »

Thanks a lot for your quick response. The LCD display (20x4 LCD for example) has a macro for displaying ASCII characters, by writing the right byte you get the desire ASCII character. For example, in order to display the letter "A" a decimal 69 is wrote on it. This is an incredible macro because you can write a string in to Eprom memory using a simple counter and you can retrieve the data when needed. For example, a telephonic directory; you need to write the name of the person to save the needed data in order to retrieve it later. Then this block of data will be save in a block called Mario for example. therefore, by choosing the word Mario, the telephone number will be display and it's e-mail address.
This is very useful for industrial controls for food processing for example because for a particular product it's necessary a block of data. It's not practical to punch every data parameter for every product. it may be 6 different settings per each product so the controllers are able to store a recipe, therefore, when you select it, automatically loads the right parameters. I could name the recipes by using numbers but then you need a list to know which product is each number. Therefore the better way is having the list build into the program. Of course, you need to be able to input a string wit regular inputs such as quadrature encoders or buttons. Then it becomes a powerful controller because the human error is reduce to almost zero (still the probability of choosing the wrong product). You don't have an idea of how much raw material is going to the garbage for a human errors such as punching the wrong parameter in the process controller. This cost is effectively reduce by having the right parameters each time a recipe is selected and loaded.
As a mention before, this can be done with the 20x4 LCD display, but a color GLCD looks more professional today days. It's like having a black and with analog TV for your project when you could have a plasma of LED HDMI flat screen TV. In order to be competitive with the modern controls, you should be able to make them look like them.
Attachments
Capture.PNG
Here is the macro
(15.13 KiB) Downloaded 5163 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Using GLCDs, Good or bad idea??

Post by kersing »

The simplest way to draw a single character would be to create a new string, 2 bytes, for example str[2]. In a calculation set the second character to zero and the first character to the ASCII value you want to have displayed. Now use the Print macro to display that string.

The code for the calculation:

Code: Select all

str[1] = 0
str[0] = value
If you know you want to display multiple characters you can increase the size of the string and put all characters to be displayed in the string (and a zero after the last character), that will reduce the overhead of multiple macro calls.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

407charles
Posts: 122
Joined: Thu Jun 26, 2014 12:01 pm
Has thanked: 41 times
Been thanked: 19 times
Contact:

Re: Using GLCDs, Good or bad idea??

Post by 407charles »

Thanks a lot for your help, I going to try that. I will see if I can implemented this strategy to create a macro to input alphabetic characters in my program.

407charles
Posts: 122
Joined: Thu Jun 26, 2014 12:01 pm
Has thanked: 41 times
Been thanked: 19 times
Contact:

Re: Using GLCDs, Good or bad idea??

Post by 407charles »

Thanks a lot Kersing, I was able to use the code to create a macro to display ASCII characters. I did a program to write on the display and it works just fine. Best regards.

Post Reply