fm:
That's the nice thing about the "New LiquidCrystal" library, it already supports a wide range of LCD controllers:
- I2C base on the PCF8574 or compatible
- 4bit and 8bit parallel
- ShiftRegister: 3wire, 2wire, 1wire (beta)
Your code would look something like this:
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C myLCD (0x27); // Base address of IO expander
void setup ()
{
menu.begin ( &myLCD, 20, 4 );
...
}
Assuming that your menu class makes the following modification:
#include <LCD.h>
void menu::begin ( LCD *iLCD, uint8_t cols, uint8_t rows )
With this LCD library you will get almost 32 fps as opposed to the one you are currently using that barely does 10fps.
Now if you want to use for example a 4bit parallel interface, the only thing that would change in you code is the creation of the LCD object:
#include <LiquidCrystal_I2C.h>
LiquidCrystal myLCD ( 12, 11, 5, 4, 3, 2 ); // Rs, E, D4, D5, D6, D7
void setup ()
{
menu.begin ( &myLCD, 20, 4 );
...
}
Not a lot to do in your code really.
You are kind enough for explaining the codes. I would be really very thankful if you please elaborate changes for ShiftRegLCD say 3-wire LCD example skecth like you posted above.
Regards