as i've said on the first post, i get the " 'LiquidCrystal' was not declared in this scope " message. so, here's the code for the header:
#ifndef MenuLCD_h
#define MenuLCD_h#include "Arduino.h"
// identificatori degli stati (bottoni e stato di idle)
#define UP 0
#define DOWN 6
#define SEL 2
#define BACK 4
#define IDLE 10class MenuLCD
{
public:
typedef struct // database menù
{
byte id; // PK: identificatore univoco della voce
byte id_par; // FK: riferimento al menu genitore della voce
char str[18]; // Stringa contenente il testo visualizzato
} MenuItem;
MenuLCD(byte rs,
byte enable,
byte d4,
byte d5,
byte d6,
byte d7,
String intro,
MenuItem _menu
);
MenuItem menu; // Database contenente le voci del menù
byte menu_lenght; // Numero di voci del menu
byte current_menu; // Menu corrente
byte current_sel; // Voce attualmente selezionata
byte pin; // Pin della pulsantiera
boolean sthToDo; // Necessità di eseguire azioni
String intro_str; // Stringa contentente l'intro
byte getFirstOption(byte submenu);
byte getLastOption(byte submenu);
byte getPreviousMenu(byte submenu);
String getMenuTitle(byte submenu);
void showIntro();
void showMenu();
virtual void doSomething(byte action);
byte buttonCheck();
void editSetting(String title, String descr, byte *val, char *list[]);
void editSetting(String title, String descr, byte *val, byte min, byte max);private:
static byte sel_dot[8]; // Carattere indicante la selezione
byte old_menu; // Menu precedente
byte old_sel; // Voce precedentemente selezionata
boolean old_sthToDo; // Stato precedente di sthToDo
void menuPrint(byte submenu, byte sel);};
#endif
and here's the one for the MenuLCD.cpp file:
#include "MenuLCD.h"
MenuLCD::MenuLCD(byte rs, byte enable, byte d4, byte d5, byte d6, byte d7, String intro, MenuItem _menu)
{
// inizializza le variabili della navigazione
current_menu = 0;
current_sel = 1;
sthToDo = false;
old_menu = 255;
old_sel = 255;
old_sthToDo = false;
// inizializza il display
LiquidCrystal lcd(rs, enable, d4, d5, d6, d7);
menu_lenght = sizeof(_menu)/sizeof(MenuItem);
lcd.begin(20, 4);
// inizializza il carattere per la selezione
sel_dot[0] = B00000;
sel_dot[1] = B00100;
sel_dot[2] = B01110;
sel_dot[3] = B11111;
sel_dot[4] = B01110;
sel_dot[5] = B00100;
sel_dot[6] = B00000;
lcd.createChar(1, sel_dot);
}
i've tried to put the #include <LiquidCrystal.h> in both of them, using various combination, but nothing changed: all i've got was that error message. by the way, this is the complete compilation log:
In file included from MenuLCD.cpp:7:
/MenuLCD.h:11:27: error: LiquidCrystal.h: No such file or directory
MenuLCD.cpp: In constructor 'MenuLCD::MenuLCD(byte, byte, byte, byte, byte, byte, String, MenuLCD::MenuItem)':
MenuLCD.cpp:18: error: 'LiquidCrystal' was not declared in this scope
MenuLCD.cpp:18: error: expected `;' before 'lcd'
MenuLCD.cpp:20: error: 'lcd' was not declared in this scope