Forum Software Ferduino code Trouble with "refreshAll"

Trouble with "refreshAll"  [SOLVED]


Post Number:#1 Post Mon May 27, 2019 2:56 pm
Posts: 7
Topics: 5
Images: 2
Solve rating: 0
Joined: Tue Aug 07, 2018 3:09 am
Topics: 5
Age: 75
Gender: None specified
National Flag:
Spain
Hello Fernando,

I have been reviewing and learning many things for several days thanks to your extensive and well documented code, however, and although it may seem strange, I have not been able to find out where the value of "refreshAll" is changed from "false" to "true" and vice versa.
Could you give me a clue?
Thank you and excuse my ignorance,

Post Number:#2 Post Mon May 27, 2019 3:30 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

Glad to hear!

Try search by (true) or (false) in all files.
The argument is passed in a function to say when the menu should be completely updated.

On setup you will find something like this:

mainScreen(true);


Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Tue May 28, 2019 3:54 am
Posts: 7
Topics: 5
Images: 2
Solve rating: 0
Joined: Tue Aug 07, 2018 3:09 am
Topics: 5
Age: 75
Gender: None specified
National Flag:
Spain
I have noticed that the statement of the "refreshAll" argument is in the declaration of the functions although I still do not know where the change between "true" and "false" is decided, I suppose it will be with a timer.

Thank you and greetings

Post Number:#4 Post Tue May 28, 2019 10:41 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

The statement is passed as argument to a function.

Example:

void mainScreen(bool refreshAll = false)


Here the variable refreshAll is declared as false by default.

This is a variable LOCAL it doesn't exists out of this function.

If you try change the value in some place of the code like this:

refreshAll = true;


You will get a compiling error:

Variable refreshAll not declared in scope.

To change the value of this variable you should pass the value as argument.

mainScreen(true);


Here you can see how it's used on code.

Check this article to learn more.

https://www.learncpp.com/cpp-tutorial/7 ... reference/

Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.




Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 1 guest

cron