Hello everyone guys,
I'm trying to make a menu on an 16x2 I2C LCD Screen (the most basic screen you can find in every starter kit)
I wanted to use MENWIZ Library by Brunialti (version 1.3.2 - GitHub - brunialti/MENWIZ_1_3_2: Editable text variables and user grants) but i can't get it working in any way, even with a basic sketch like this one that i'll post below my Arduino Duemilanove keeps on resetting because (i think) it runs out of memory everytime it enters loop (if i comment "tree.draw()" function it stops giving error.
//The full code is in library example file Quick_tour.ino
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <buttons.h>
#include <MENWIZ.h>
#include <EEPROM.h>
// DEFINE ARDUINO PINS FOR THE NAVIGATION BUTTONS
#define UP_BOTTON_PIN 9
#define DOWN_BOTTON_PIN 10
#define LEFT_BOTTON_PIN 7
#define RIGHT_BOTTON_PIN 8
#define CONFIRM_BOTTON_PIN 12
#define ESCAPE_BOTTON_PIN 11
menwiz tree;
// create lcd obj using LiquidCrystal lib
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
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"));
s1=tree.addMenu(MW_VAR,r, F("Node2"));
s1->addVar(MW_ACTION,myfunc);
tree.navButtons(UP_BOTTON_PIN,DOWN_BOTTON_PIN,LEFT_BOTTON_PIN,RIGHT_BOTTON_PIN,ESCAPE_BOTTON_PIN,CONFIRM_BOTTON_PIN);
}
void loop(){
tree.draw();
}
void myfunc(){
Serial.println("ACTION FIRED");
}
This is just the example sketch given with the library, i removed some of the menus it was creating to keep this the simplest possible just to test it, but there's no way i can get this working. The screen keeps blinking backlight LED very fast, and by adding some debugging "Serial.println" and some delays i found, like i explained before, that my arduino keeps resetting itself.
What else should i do? Are there any other Menu library here arround i still didn't found?
Thanks a lot to everyone
Alessandro.