FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: FT813 non const text display?  (Read 149 times)

ConfusedIrishMan

  • Newbie
  • *
  • Posts: 6
    • View Profile
FT813 non const text display?
« on: October 27, 2019, 04:08:37 PM »

Hi,

Using the newhaven 7" ft813 connected to an Arduino.

I am using  Ft_Gpu_CoCmd_Text(phost,140,30,31,0,"test");

to display the word test on the screen.

However the screen is part of a bigger project (naturally) and I would like to be able to change the text depending on other conditions.

String x = "test";
Something like  Ft_Gpu_CoCmd_Text(phost,140,30,31,0,x);

However this obviously isn't as straightforward as that as the function declaration for  Ft_Gpu_CoCmd_Text defines the text parameter as a const.

Is there anyway around this? I can think of a few brute force methods such as look up tables etc but just asking incase I am missing something basic.

Thanks for an help.
Logged

FTDI Community

  • Administrator
  • Sr. Member
  • *****
  • Posts: 335
    • View Profile
Re: FT813 non const text display?
« Reply #1 on: October 28, 2019, 12:05:21 PM »

Hi,

You can use string commands (such as sprintf) to write a string into the string variable x. This will allow you to create the string and then display it rather than have the hard-coded text string.

Best Regards,
FTDI Community
Logged

ConfusedIrishMan

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: FT813 non const text display?
« Reply #2 on: October 28, 2019, 01:06:30 PM »

Thanks for the prompt reply.

Yes I understand I can place a String variable instead of a hard coded string.

However, The string variable that I place inside the function has to be a constant.

Is there any way around this?

I am updating a String variable from elsewhere and would like to display the new String when the variable changes.

Not sure if I am explaining this very well.
Logged

ConfusedIrishMan

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: FT813 non const text display?
« Reply #3 on: October 30, 2019, 04:11:11 PM »

Hi,

You can use string commands (such as sprintf) to write a string into the string variable x. This will allow you to create the string and then display it rather than have the hard-coded text string.

Best Regards,
FTDI Community

Got this sorted in the end. Your suggestion worked in a roundabout way. Thanks for the help
Logged

FTDI Community

  • Administrator
  • Sr. Member
  • *****
  • Posts: 335
    • View Profile
Re: FT813 non const text display?
« Reply #4 on: November 01, 2019, 11:51:03 AM »

Hi,

Glad it helped and thanks for letting us know,

Just to add, if you were originally trying to update variables on the screen without re-sending the command list, it is generally necessary to re-send the commands to create each screen update rather than have a change reflected on the screen in real time.

There are a couple of techniques that can help minimise the amount of the display which you re-send in AN_340 below and we also use the technique in several other examples such as section 9 of BRT_AN_014 and our sample apps too.

https://brtchip.com/wp-content/uploads/Support/Documentation/Application_Notes/ICs/EVE/AN_340_FT800_Optimising-screen-updates-with-Macro-and-Append.pdf

https://brtchip.com/wp-content/uploads/Support/Documentation/Application_Notes/ICs/EVE/BRT_AN_014_FT81X_Simple_PIC_Library_Examples.pdf

Best Regards, FTDI Community

Logged