Go Down

Topic: MENWIZ: yet another character lcd menu wizard library (Read 78 times) previous topic - next topic

calim

Hi there,
including or uncommenting eeprom support had no effect because I didn't use it anyway. I tried different values of MAX_MENU. With 25 it has freeRam of 198. With 30 it has 98 and produces the error, with 29 it has 118 and the values in the las menu jump around wild but the menu point still is available after leaving the menu, with 28 it has 138 freeRam and everything works fine. I hope it still does when I have created all of the scetch. :)

Thanks, calim

@elpaso: good idea with the label duplication. I'll try it for my time-setting menus. However, I don't know how to declare a const __FlashStringHelper*. When I try
Code: [Select]
const __FlashStringHelper* hh="Stunde"; I get
Code: [Select]
cannot convert 'const char*' to 'const __FlashStringHelper*' in initialization
~~User of the mighty Arduino Nano v3.0~~

brunialti

#181
Sep 08, 2012, 05:59 pm Last Edit: Sep 10, 2012, 02:28 pm by brunialti Reason: 1
About eeprom : you have to comment #define EEPROM_SUPPORT  *AND * you have to not include the EEPROM.h lib in your sketch. In this way MENWIZ saves some memory both in progmem (about 900 bytes) and in ram memory (just a little bit) independently from the fact that you use or not the provided methods.

I think the next version will include a check to control duplicated label strings ... It seems to be too easy to implement ... to not implement it .

I hope to optimize the code in order to save some memory (but I think it could be not more than about 100 bytes). In the meantime  :smiley-roll-sweat: if you use arduino Mega or any compatible board with the same microcontroller  (or even better the Due) you of course will have no problems ...


EDIT the duplication check is a nonsense code. Once you insert F("....") inside the sketch code you allocate at compile time the space. The method inside MENWIZ only store the pointer of type "const __FlashStringHelper*". It does not allocate any memory. The only way to spare memory is to pass a pointer variable to a const __FlashStringHelper data type for any duplicate string. But that is up to the user. Menwiz cannot do any memory save at that point.

calim

Hi,
I did check my files and MENWIZ.h already has
Code: [Select]
//#define EEPROM_SUPPORT     //uncomment if you want to use the readEeprom and writeEeprom methods! and in my scetch I have
Code: [Select]
#include <Wire.h>
#include <Time.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <buttons.h>
#include <MENWIZ.h>
//#include <EEPROM.h>
so it seems it is not the eeprom that's eating up RAM but one of the other libraries. When I have time I will do the whole menu and check the memory again. May be next week. Then I'll try lower values of MAX_MENU.
Thanks! calim

PS: I'm using an Arduino Nano v3.0
~~User of the mighty Arduino Nano v3.0~~

brunialti

I suppose you have the ATmega328 version, is'nt it?

calim

Hi,
yes, the Nano v3 comes with the ATmega 328. It should have the full power of the Uno.  8)
calim
~~User of the mighty Arduino Nano v3.0~~

Go Up