multiple reference for one library

Is it possible to reuse code snippets that access a specific library?

Like say I have 2 LCDs and want to share everything between them except for the Enable pin.
I would reference them as lcd1 and lcd2

how can I pass control to a snippet that could write to either lcd1 or lcd2 ambiguously?

Code like this doesn't work:

#include <LiquidCrystal.h>
LiquidCrystal lcd1(8,10,3,4,5,6,7);//rs, rw, en, d4,5,6,7
LiquidCrystal lcd2(8,10,2,4,5,6,7);//rs, rw, en, d4,5,6,7

void test(abc)
{
abc.clear();
}

void setup()
{
test(lcd1);
}

void loop()
{

}
#include <LiquidCrystal.h>
LiquidCrystal lcd1(8,10,3,4,5,6,7);//rs, rw, en, d4,5,6,7
LiquidCrystal lcd2(8,10,2,4,5,6,7);//rs, rw, en, d4,5,6,7

void test(LiquidCrystal& abc)
{
  abc.clear();
}

void setup()
{
  test(lcd1);
  test(lcd2);
}

void loop()
{

}

:slight_smile:

You rock!