brunialti / MENWIZ

ARDUINO LCD menu library: short user code to manage complex menu structures
65 stars 25 forks source link

MW_LIST and 4 button support #1

Closed hayden-t closed 12 years ago

hayden-t commented 12 years ago

Hi, firstly thanks for the library, i got it running easy enough with a 16x2 and 4 buttons.

But in your demo the MW_LIST section (option 1, 2, 3) i can't change the value from the default 'option 1' even though i can change the value in the speed section

thanks, Hayden.

brunialti commented 12 years ago

I cannot reply the bug. Neverthless I uploated the 0.5.3 version I'm working with. It should work correctly. Please confirm it as asoon as you can test it. By the way I noticed there was an error in the examples ....

hayden-t commented 12 years ago

i tried but could not compile your quick tour (modified for my setup)

Quick_tour.cpp: In function 'void setup()': Quick_tour:25: error: no matching function for call to 'menwiz::addMenu(int, NULL, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:168: note: candidates are: menu menwiz::addMenu(int, menu, char_) Quick_tour:26: error: no matching function for call to 'menwiz::addMenu(int, menu&, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:168: note: candidates are: _menu* menwiz::addMenu(int, menu, char_) Quick_tour:27: error: no matching function for call to 'menwiz::addMenu(int, menu&, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:168: note: candidates are: _menu* menwiz::addMenu(int, menu, char_) Quick_tour:29: error: no matching function for call to '_menu::addItem(int, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:146: note: candidates are: option menu::addItem(int, char) Quick_tour:30: error: no matching function for call to '_menu::addItem(int, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:146: note: candidates are: _option* menu::addItem(int, char) Quick_tour:31: error: no matching function for call to '_menu::addItem(int, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:146: note: candidates are: _option* menu::addItem(int, char) Quick_tour:32: error: no matching function for call to 'menwiz::addMenu(int, menu&, _FlashStringHelper)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:168: note: candidates are: menu menwiz::addMenu(int, menu, char_) Quick_tour:34: error: no matching function for call to 'menwiz::addMenu(int, menu&, _FlashStringHelper)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:168: note: candidates are: _menu* menwiz::addMenu(int, menu, char_)

include

include

include

include

include

// DEFINE ARDUINO PINS FOR THE NAVIGATION BUTTONS

define UP_BOTTON_PIN 3

define DOWN_BOTTON_PIN 4

define CONFIRM_BOTTON_PIN 2

define ESCAPE_BOTTON_PIN 5

menwiz tree; // create lcd obj using LiquidCrystal lib LiquidCrystal lcd ( 12, 11, 10, 9, 8, 7 );

int list,sp=110;

void setup(){ _menu _r,_s1,*s2;

Serial.begin(19200);
tree.begin(&lcd,20,4); //declare lcd object and screen size to menwiz lib

r=tree.addMenu(MW_ROOT,NULL,F("Root")); s1=tree.addMenu(MW_SUBMENU,r,F("Node1")); s2=tree.addMenu(MW_VAR,s1,F("Node3")); s2->addVar(MW_LIST,&list); s2->addItem(MW_LIST,F("Option1")); s2->addItem(MW_LIST,F("Option2")); s2->addItem(MW_LIST,F("Option3")); s2=tree.addMenu(MW_VAR,s1,F("Node4")); s2->addVar(MW_AUTO_INT,&sp,0,120,10);
s1=tree.addMenu(MW_VAR,r,F("Node2")); s1->addVar(MW_ACTION,myfunc); tree.navButtons(UP_BOTTON_PIN,DOWN_BOTTON_PIN,ESCAPE_BOTTON_PIN,CONFIRM_BOTTON_PIN);
}

void loop(){ tree.draw(); }

void myfunc(){ Serial.println("ACTION FIRED!"); }

hayden-t commented 12 years ago

what was wrong with your quick tour b4 ?

brunialti commented 12 years ago

Sorry. I mixed examples of version 0.5.3 with the new version I'm working with (it uses flash memory to store string). In the exampke you'll see F("...") when you call addMenu functions. In the 0.5.3 version it should be only "...". I'LL CHANGE ASAP

-----Messaggio originale----- Da: hayden-t [mailto:reply@reply.github.com] Inviato: sabato 14 luglio 2012 11:12 A: roberto brunialti Oggetto: Re: [MENWIZ] MW_LIST and 4 button support (#1)

i tried but could not compile your quick tour (modified for my setup)

Quick_tour.cpp: In function 'void setup()': Quick_tour:25: error: no matching function for call to 'menwiz::addMenu(int, NULL, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:168: note: candidates are: menu menwiz::addMenu(int, menu, char_) Quick_tour:26: error: no matching function for call to 'menwiz::addMenu(int, menu&, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:168: note: candidates are: _menu* menwiz::addMenu(int, menu, char_) Quick_tour:27: error: no matching function for call to 'menwiz::addMenu(int, menu&, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:168: note: candidates are: _menu* menwiz::addMenu(int, menu, char_) Quick_tour:29: error: no matching function for call to '_menu::addItem(int, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:146: note: candidates are: option menu::addItem(int, char) Quick_tour:30: error: no matching function for call to '_menu::addItem(int, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:146: note: candidates are: _option* menu::addItem(int, char) Quick_tour:31: error: no matching function for call to '_menu::addItem(int, FlashStringHelper_)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:146: note: candidates are: _option* menu::addItem(int, char) Quick_tour:32: error: no matching function for call to 'menwiz::addMenu(int, menu&, _FlashStringHelper)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:168: note: candidates are: menu menwiz::addMenu(int, menu, char_) Quick_tour:34: error: no matching function for call to 'menwiz::addMenu(int, menu&, _FlashStringHelper)' C:\Users\User\Desktop\arduion\arduino-1.0.1\libraries\MenWiz/MENWIZ.h:168: note: candidates are: _menu* menwiz::addMenu(int, menu, char_)

include

include

include

include

include

// DEFINE ARDUINO PINS FOR THE NAVIGATION BUTTONS

define UP_BOTTON_PIN 3

define DOWN_BOTTON_PIN 4

define CONFIRM_BOTTON_PIN 2

define ESCAPE_BOTTON_PIN 5

menwiz tree; // create lcd obj using LiquidCrystal lib LiquidCrystal lcd ( 12, 11, 10, 9, 8, 7 );

int list,sp=110;

void setup(){ _menu _r,_s1,*s2;

Serial.begin(19200);
tree.begin(&lcd,20,4); //declare lcd object and screen size to menwiz lib

r=tree.addMenu(MW_ROOT,NULL,F("Root")); s1=tree.addMenu(MW_SUBMENU,r,F("Node1")); s2=tree.addMenu(MW_VAR,s1,F("Node3")); s2->addVar(MW_LIST,&list); s2->addItem(MW_LIST,F("Option1")); s2->addItem(MW_LIST,F("Option2")); s2->addItem(MW_LIST,F("Option3")); s2=tree.addMenu(MW_VAR,s1,F("Node4")); s2->addVar(MW_AUTO_INT,&sp,0,120,10);
s1=tree.addMenu(MW_VAR,r,F("Node2")); s1->addVar(MW_ACTION,myfunc); tree.navButtons(UP_BOTTON_PIN,DOWN_BOTTON_PIN,ESCAPE_BOTTON_PIN,CONFIRM_BOTTON_PIN); }

void loop(){ tree.draw(); }

void myfunc(){ Serial.println("ACTION FIRED!"); }


Reply to this email directly or view it on GitHub: https://github.com/brunialti/MENWIZ/issues/1#issuecomment-6981399

hayden-t commented 12 years ago

ok so i took out those bits and it compiles and runs now. so now i can toggle the checked state of option1 with my up and down buttons but cant access the other option. i suspect its not meant to act like this

brunialti commented 12 years ago

Please find the new example codes aligned to the 0.5.3 version available on Github I suggest, if you don’t, to use download to get the whole package. Next version will use F() operator to spare memory. Let me know if all is ok.

-----Messaggio originale----- Da: hayden-t [mailto:reply@reply.github.com] Inviato: sabato 14 luglio 2012 11:13 A: roberto brunialti Oggetto: Re: [MENWIZ] MW_LIST and 4 button support (#1)

what was wrong with your quick tour b4 ?


Reply to this email directly or view it on GitHub: https://github.com/brunialti/MENWIZ/issues/1#issuecomment-6981408

hayden-t commented 12 years ago

yeah its fine now, i missed to change the lcd lines, thats why it was acting strange in my last post.

brunialti commented 12 years ago

If you like, follow also the thread about menwiz on Arduino site forum: http://arduino.cc/forum/index.php?topic=99693.new;topicseen

That is the true place to ask for sharing experience, advice, request and so on.

Roberto

-----Messaggio originale----- Da: hayden-t [mailto:reply@reply.github.com] Inviato: sabato 14 luglio 2012 11:44 A: roberto brunialti Oggetto: Re: [MENWIZ] MW_LIST and 4 button support (#1)

ok so i took out those bits and it compiles and runs now. so now i can toggle the checked state of option1 with my up and down buttons but cant access the other option. i suspect its not meant to act like this


Reply to this email directly or view it on GitHub: https://github.com/brunialti/MENWIZ/issues/1#issuecomment-6981607