Hi,
Controlling several lcd screen like on this topic works good for me: http://arduino.cc/forum/index.php/topic,5014.0.html. It's fantatic!!!!
But now, I'd like to be abble to select which lcd (lcd0, lcd1, lcd2...etc), with only one variable like i, where i is from 0 to 4.
I tried the following code
#include <LiquidCrystal.h>
LiquidCrystal lcd0(22, 23, 24, 26, 28, 30);
LiquidCrystal lcd1(22, 25, 24, 26, 28, 30);
LiquidCrystal lcd2(22, 27, 24, 26, 28, 30);
LiquidCrystal lcd3(22, 29, 24, 26, 28, 30);
LiquidCrystal lcd4(22, 31, 24, 26, 28, 30);
char *LCD[5] = {"lcd0", "lcd1", "lcd2", "lcd3", "lcd4"};
void setup()
{
for (int i=0; i<=4;i++)
{
LCD[i].begin(16,2);
LCD[i].clear();
LCD[i].setCursor(0,0);
}
}
void loop()
{
for (i=0; i<=4;i++)
{
LCD[i].setCursor(0,0);
LCD[i].print("blablabla : ");
LCD[i].print(i);
}
}
But the compiler reject it with " request for member 'begin' in 'LCD_', which is of non-class type 'char*'"._
Is there a way to make it ? Any clue to guide me for that? The need for this is to be abble to select the lcd number with a number in a variable.
Thanks you very much,
Lionel