|
您好coloz, 我在使用Arduino UNO, IDE 1.8.5, Win 10 系统。我在GitHub中下载了LCD.cpp & LCD.h 和 LiquidCrystal.cpp & LiquidCrystal.h 可是所有 lcd.--- 的程序都报错。我把说有 wprogram.h 都改成了 arduino.h,并且使用查地址的程序查出来address的确是0x27。所有的线都是连的对的。在Reddit中的解决方案都不可用。我怀疑是不是库的问题。万分感谢高手。
程序:
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2,1,0,4,5,6,7); // check 0x__ (this case 0x27) address using LCDtrial_01
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2); // for a 16*2 LCD module
lcd.setBacklightPin(3,OUTPUT);
lcd.setBacklight(HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
lcd.home(); // set cursor to 0,0
lcd.print("HelloWorld");
lcd.setCursor(0,1); // go to second line
lcd.print("_12 # 啊 [ ");
//delay(1000);
//lcd.setBacklight(LOW);
//lcd.setBacklight(HIGH);
}
报错:
In file included from C:\Users\jc135\Desktop\Arduino\LCDtrial_02\LCDtrial_02.ino:4:0:
C:\Users\jc135\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:261:70: error: 'LCD_5x8DOTS' was not declared in this scope
virtual void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS);
^
C:\Users\jc135\Desktop\Arduino\LCDtrial_02\LCDtrial_02.ino: In function 'void setup()':
LCDtrial_02:10: error: call to 'virtual void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)' uses the default argument for parameter 3, which is not yet defined
lcd.begin(16,2); // for a 16*2 LCD module
^
LCDtrial_02:11: error: 'class LiquidCrystal_I2C' has no member named 'setBacklightPin'
lcd.setBacklightPin(3,OUTPUT);
^
LCDtrial_02:12: error: no matching function for call to 'LiquidCrystal_I2C::setBacklight(int)'
lcd.setBacklight(HIGH);
^
C:\Users\jc135\Desktop\Arduino\LCDtrial_02\LCDtrial_02.ino:12:24: note: candidate is:
In file included from C:\Users\jc135\Documents\Arduino\libraries\LiquidCrystal_I2C/LiquidCrystal_I2C.h:73:0,
from C:\Users\jc135\Desktop\Arduino\LCDtrial_02\LCDtrial_02.ino:4:
C:\Users\jc135\Documents\Arduino\libraries\LCD/LCD.h:50:14: note: void LCD::setBacklight(boolean, int)
void setBacklight(boolean on, int minutesOn);
^
C:\Users\jc135\Documents\Arduino\libraries\LCD/LCD.h:50:14: note: candidate expects 2 arguments, 1 provided
C:\Users\jc135\Desktop\Arduino\LCDtrial_02\LCDtrial_02.ino: In function 'void loop()':
LCDtrial_02:17: error: 'class LiquidCrystal_I2C' has no member named 'home'
lcd.home(); // set cursor to 0,0
^
LCDtrial_02:18: error: 'class LiquidCrystal_I2C' has no member named 'print'
lcd.print("HelloWorld");
^
LCDtrial_02:20: error: 'class LiquidCrystal_I2C' has no member named 'print'
lcd.print("_12 # å•Š [ ");
^
exit status 1
call to 'virtual void LiquidCrystal_I2C::begin(uint8_t, uint8_t, uint8_t)' uses the default argument for parameter 3, which is not yet defined
谢谢
|
|