Hi Bruno, recently found your menuwiz library, Its powerful, flexible, simple to use, and best of all is runs asyncronously letting other pgm code run.
I plan to use it with an i2C LCD display that has button inputs, it comes with its own LCD_I2C front end interface to the WIRE lib. Its called LCDI2Cw lib from web4robot. The lcd display uses a Hitachi HD44780 chipset. It has the following functions:
// available functions
/********************************************
void clear();
void home(); // set cursor to row 0, col 0
void noDisplay();
void display();
void noBlink();
void blink();
void noCursor();
void cursor();
void cursorLeft();
void cursorRight();
void scrollDisplayLeft();
void scrollDisplayRight();
void createChar(uint8_t, uint8_t[]);
void setCursor(uint8_t, uint8_t); // col, row, rows 0 to 3, column 0 to 19
unsigned int firmware();
void keypadMode(uint8_t mode); // 0 = 4x4 butron matrix, 1 = 8 separate buttons, default is 0
unsigned int keypad ();
unsigned int remoteCtr ();
void backlight(uint8_t light); // 0 to 250, default is 70
void contrast(uint8_t contrast); // 0 to 100, default is 20
********************************************/
Can I replace the following includes in your example pgms to this to use this i2clcd lib?
#include <Wire.h>
#include <LCDI2Cw.h>
#include <MENUWIZ.h>
unsigned char i2cAddress = 0x4C; // LCD module I2C address
const int myrows = 4;
const int mycols = 20;
LCDI2Cw lcd(mycols, myrows, i2cAddress); // this lcd object is used my menuwiz
Questions:
-
Will I need to modify your MENUWIZ.h and cpp files to use my LCDI2Cw lib and remove references to LiquidCrytsal and buttons?
-
I also plan to add my own button handler (addUsrNav(navMenu), my question is where to I put my code to read the buttons so the button handler called from the menu.draw() function can process my button presses. It looks like I should add a call to my readButtons() function in the main loop just after the call to menu.draw().
Is this correct?
Thanks
Tom