Hallo,
hoffe mir kann hier jemand helfen!
Ich hab ein Problem mit der Library "LiquidCrystal_I2C". Hab sie ganz normal eingebunden und auch die examples funktionieren ohne Probleme. Jedoch im eigentlichen sketch bekomme ich immer wieder den Fehler:
{{{ LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin); }}}
line. It says [[[no matching function for call to 'LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int)']]].
Was mach ich falsch?
// Bench PSU Arduino LCD
// by Iqbal Ibrahim
// for Instructables.com
// August 2015
/*-----( Import needed libraries )-----*/
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
/*-----( Declare Constants and Pin Numbers )-----*/
#define I2C_ADDR 0x27 // <<----- Add your address here. Find it from I2C Scanner
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
#define Vpower 5.22
#define PWROK_PIN 4
#define PWRBTN 2
#define PWRTRANS 6
/*-----( Declare objects )-----*/
// Variables will change:
int PWRSTATE = HIGH; // the current state of the output pin
int buttonState; // the current reading from the input pin
int lastButtonState = LOW; // the previous reading from the input pin
// the following variables are long's because the time, measured in miliseconds,
// will quickly become a bigger number than can be stored in an int.
long lastDebounceTime = 0; // the last time the output pin was toggled
long debounceDelay = 50; // the debounce time; increase if the output flickers
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
/*-----( Declare Variables )-----*/
byte blockChar[8] = {
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111,
0b11111
};
float threevoltin, fivevoltin, twelvevoltin, vronein, vrtwoin;
float threevolts, fivevolts, twelvevolts, vronevolts, vrtwovolts;
void LCDSetup(){
lcd.begin(20,4);
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);
lcd.setCursor(0,0);
lcd.print(" Bench PSU Monitor ");
lcd.setCursor(0,1);
lcd.print(" V1.0 2015 ");
lcd.setCursor(0,2);
lcd.print(" By Iqbal Ibrahim ");
lcd.setCursor(0,3);
lcd.print(" www.thebal.co.uk ");
delay(2000);
lcd.clear();
lcd.createChar(0, blockChar);
}
void LabelSetup(){
lcd.setCursor(0,0);
lcd.print("3V3: V 5V: V");
lcd.setCursor(0,1);
lcd.print("12V: V");
lcd.setCursor(0,2);
lcd.print("VR1: V POWER ");
lcd.setCursor(0,3);
lcd.print("VR2: V ");
}
void topLeftBlock(){
lcd.setCursor(18,2);
lcd.write((uint8_t)0);
lcd.print(" ");
lcd.setCursor(18,3);
lcd.print(" ");
}
void topRightBlock(){
lcd.setCursor(18,2);
lcd.print(" ");
lcd.write((uint8_t)0);
lcd.setCursor(18,3);
lcd.print(" ");
}
void bottomLeftBlock(){
lcd.setCursor(18,2);
lcd.print(" ");
lcd.setCursor(18,3);
lcd.write((uint8_t)0);
lcd.print(" ");
}
void bottomRightBlock(){
lcd.setCursor(18,2);
lcd.print(" ");
lcd.setCursor(18,3);
lcd.print(" ");
lcd.write((uint8_t)0);
}
void readVoltages(){
threevoltin = (analogRead(A0)* Vpower)/1024.0;
fivevoltin = (analogRead(A1)* Vpower)/1024.0;
twelvevoltin = (analogRead(A3)* Vpower)/1024.0;
vronein = (analogRead(A6)* Vpower)/1024.0;
vrtwoin = (analogRead(A7)* Vpower)/1024.0;
}
void calculatePrintVoltages(){
threevolts = threevoltin;
lcd.setCursor(5,0); lcd.print(threevolts);
fivevolts = (fivevoltin)/ (1770.0/(182.0+1770.0));
lcd.setCursor(15,0); lcd.print(fivevolts);
twelvevolts = (twelvevoltin ) / (1770.0/(4650.0+1770.0));
lcd.setCursor(5,1); lcd.print(twelvevolts);
vronevolts = (vronein ) / (1770.0/(11890.0+1770.0));
lcd.setCursor(5,2); lcd.print(vronevolts);
vrtwovolts = (vrtwoin ) / (1770.0/(11920.0+1770.0));
lcd.setCursor(5,3); lcd.print(vrtwovolts);
}
void checkPowerOK(){
if (digitalRead(PWROK_PIN) == HIGH) {
lcd.setCursor(13,3);
lcd.print("ON ");
}
else if (digitalRead(PWROK_PIN) == LOW) {
lcd.setCursor(13,3);
lcd.print("OFF");
}
}
void togglePower(){
static unsigned long last_interrupt_time = 0;
unsigned long interrupt_time = millis();
// If interrupts come faster than 200ms, assume it's a bounce and ignore
if (interrupt_time - last_interrupt_time > 500)
{
// set the power:
digitalWrite(PWRTRANS, PWRSTATE);
}
PWRSTATE = !PWRSTATE;
last_interrupt_time = interrupt_time;
}
void setup() /****** SETUP: RUNS ONCE ******/
{
LCDSetup();
LabelSetup();
pinMode(PWRBTN, INPUT);
pinMode(PWRTRANS, OUTPUT);
attachInterrupt(0, togglePower, RISING);
digitalWrite(PWRTRANS, PWRSTATE);
}
//--(end setup )---
void loop() /****** LOOP: RUNS CONSTANTLY ******/
{ checkPowerOK();
readVoltages();
calculatePrintVoltages();
topLeftBlock();
delay(250);
readVoltages();
calculatePrintVoltages();
topRightBlock();
delay(250);
readVoltages();
calculatePrintVoltages();
bottomRightBlock();
delay(250);
readVoltages();
calculatePrintVoltages();
bottomLeftBlock();
delay(250);
}
//--(end main loop )---
//*********( THE END )***********