so from my point of view i think that the best could be "Method 2" or "Method 3" if not understood bad the difference is that with the "Method 3" is possible run a procedure ?
with this method for example could i do a cycle for change the "linebuf" ? I will be update automatically on display ? or each time will be necessary press button for update it ?
another thing that I would like to ask you is that ... on my menu now for example when I entry into the menu for "turn on" or "turn off" off the devices I see a strange value example:
Actually Menu:
Dev: 85 State: 255
back ok zero
How should be:
Dev: 00 State: 0
back ok zero
when I press select button the value come back to 0 like should be and also the state after press select button come back to 0 like should be ...
for sure the variable are initialized to 0 before entry into the menu
with this method for example could i do a cycle for change the "linebuf" ? I will be update automatically on display ? or each time will be necessary press button for update it ?
The content of linebuf will be displayed whenever you execute m2.draw(). Anything else is under your control. This means: If you update linebuf you should call m2.draw() to make your changes visiable.
Actually Menu:
Dev: 85 State: 255
back ok zero
M2tklib will display the value of the "connected" variable. Nothing else. Are you sure that there is no programming error, assigning 85 to the device value?
Thanks for the information,
I've intercept the issues ... I've change the type of variable from uint8_t to byte ...
the logical part was ok, but probably there was a "memory overlapping" between variable ... is possible ?
Ciao Oliver,
during the weekend, I've thought how to use ... so I'll try to use a mixed mode to put &null element to display for disable the menu and then enable the menu again ...
So, Id like to do is also ... so now i didn't have the exit button ... and for didn't wasting memory I was thing to this:
I want that when I'm inside my menu when I click on something the menu will go on the welcome screen ...
for do that I've thing to put a "Exit" voices into the menu is possible ? Is possible also do something without didn't a sub menu ? so for example to the voice exit when I click the select but will go directly to welcome screen ...
This should work with the "HOME" button. This means, do not use the Exit button, but instead the HOME button (M2_KEY_HOME). Assign the "home" menu with setHome(). This also could be the &null element.
Good Morning Oliver,
And for do that I need physically another button correct ? so it's very complete your menu ! Many Congratulations ... !!! So I promise to you that when I'll finish the project I'll send to you a gift please send to me in private if you want without you I was completely lost ...
So the final things that I want do for the moment is that ... in attachment you can see a a combo menu ... I've take this simple example from a library ... one time that i will press ok I will store the value devices and the "Is" name (only the index) inside my array ... for example like this:
array[0][13] = idx;
array[0][0] = &u8num;
Then I would like retrieve this value inside another menù:
I would like that for example when I'm inside the menu device when I click on "Dev: 01" Will appear kitchen ...
In this way I can say what Im managing ...
You can calculate the amount of initially occupied RAM and ROM memory.
Use "avr-size" for this task. You need to locate and find the .elf file on your file system.
So, I did you this questions because this morning i was doing the final menu and one time that I've the third menu the has stop to work ... I've tried both in serial and on lcd ... removing this menu everything was working ok ... and my sketch is only 25000 I've avaiable again 8000 byte if i not wrong ... also taking another menu from an example is the same ...
for sure the code seems correct ... I didn't see any big changes between the other only I've used 2 Label function ... so in 4 hour that im working on that I've tried a lot's of thing change variable type from u8int to char ... but nothing to do ... Now I go for launch because Im completely fuse ...
thanks for help me,
gnux
Also I've looked inside the tutorial for pass value to the call back procedure for M2_LABELFN I but I didn't find a way so could be more useful below you can find the code ...
if i try to pass parameter I've back a issues with the conversion for sure i wrong to pass it ...
So, now I'd like to re-use the procedure above and pass like parameter "linebuf" is there a way to pass parameter ? I've tried but without success ...
I think it's possible, I've tried in several way but I've issues in "M2_LABELFN(el_labefn2, "x10y3", label_what);"
No problem was just investigating for optimize at the top my code ... right now I'm using 28.200 byte on 32000 available ... I need to look your link that you have sent to me in order to understand how to put the global variable in SRAM in order to use all Flash Memory for the program I think that after that i will manage correctly my at328pu ... make sense for you ?
So, in a previous post you was mentioning this :
"You can calculate the amount of initially occupied RAM and ROM memory.
Use "avr-size" for this task. You need to locate and find the .elf file on your file system."
I've found .elf file for my sketch now is there a software to download for see how are located the variable ?
because looking the documentation it's a little bit difficult to understand sorry... i need to be little bit confident with it like did for display library ... anyway i will try to read again ...
I need to understand now this data ... are express in byte ?
Which is the maximum limit that I've have ? So I would like to understand if I've use correctly the space for the program memory and the space for the variable ...