All.
I do OK at programming and sort most issued out, that's how I learn. I think this is a pointer thing, to be honest they fry my brain!
I am using the LCD_IC2.h library.
I have two 2x16 displays, and I can print OK to either or both, What I need to do is drop power to the LCD when it is asleep via an external transistor, that works just fine. So does my function if I have only 1 LCD. What do I need to do , ehat pointer or data type to pass in the lcd objects?
Code excerpts:
#include <LCD_I2C.h>
LCD_I2C lcd1(0x27, 16, 2);
LCD_I2C lcd2(0x3F, 16, 2);
Function Definition
// User Defined Functions
bool lcdPower(int powerPin, bool state) {
// turn on/off electrical power to lcd module
if(state){
digitalWrite(powerPin, state);
lcd.backlight();
lcd.display();
lcd.clear();
} else {
lcd.clear();
lcd.noBacklight();
lcd.noDisplay();
digitalWrite(powerPin, state);
}
return state;
}
Function call
lcdActive = lcdPower(lcdPowerPin, false);
}
This works fine for 1 LCD. How do I pass in more than 1 as a third parameter?
As Shakespeare said, "That is the question".
I don't expect you to provide a code specific answer, just give me pointers and guidance so I can fix it myself and learn "how and why" it works.
[Sorry I couldn't find a more specific Forum Category to post this in.]
Rob