about gb.titleScreen

Understanding the language, error messages, etc.

about gb.titleScreen

Postby Cerus33 » Sat Aug 09, 2014 6:28 pm

I try to ask in english :p

When i code gb.titleScreen(F("test"));
i had this message when i compile: 'F' was not declared in ths scope.
But when i see some exemple, i don't understand why, and when i code like this: gb.tittleScreen(("test")); it compile it.

what is the problem?
User avatar
Cerus33
 
Posts: 18
Joined: Tue Jul 15, 2014 9:27 pm

Re: about gb.titleScreen

Postby Limited » Sat Aug 09, 2014 7:29 pm

The F is because it is expecting a __FlashStringHelper, which basically means it ensures that the literal string is stored in Flash memory (the code space rather than the data space).

Do you have the correct includes when you use F()?
Limited
 
Posts: 13
Joined: Sat May 31, 2014 7:25 pm

Re: about gb.titleScreen

Postby Cerus33 » Sat Aug 09, 2014 8:07 pm

I see again and i think the problem is the logo i want display.

when i code: gb.titleScreen(F("test"), logo); it return error and whith no F, its good.
Perhaps it is the logo can't stored in flash memory ?
User avatar
Cerus33
 
Posts: 18
Joined: Tue Jul 15, 2014 9:27 pm

Re: about gb.titleScreen

Postby rodot » Sat Aug 09, 2014 10:28 pm

You should take a look at the gb.titleScreen page, it explains how it works. Can you compile the example?

In the examples the logo is stored in progmem because the "PROGMEM" keyword is used in the variable declaration:
Code: Select all
static unsigned char PROGMEM logo[]=

The macro F(" ") should be used only for inline text. You can't use it on variables.
User avatar
rodot
Site Admin
 
Posts: 1290
Joined: Mon Nov 19, 2012 11:54 pm
Location: France


Return to Programming Questions

Who is online

Users browsing this forum: No registered users and 64 guests