0

程式碼

==================

//Compatible with the Arduino IDE 1.0
//Library version:1.1
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
lcd.init(); // initialize the lcd

// Print a message to the LCD.
lcd.backlight();
lcd.print("Hello, world!");
}

void loop()
{
// 將游標設到  第一行,  第二列
// (注意:  第二列第五行,因為是從 0 開始數起):
lcd.setCursor(5, 0);
// 列印 Arduino 重開之後經過的秒數
lcd.print(millis() / 1000);
lcd.setCursor(6, 1);
// 列印 Arduino 重開之後經過的秒數
lcd.print(millis() / 1000);
delay(200);
}

=============

 

編譯錯誤訊息

===============

sketch_jan11a.ino:6:34: error: invalid conversion from 'int' to 't_backlighPol' [-fpermissive]
In file included from sketch_jan11a.ino:4:0:
D:\Ameba_IDE\hardware\arduino\ameba\libraries\Ameba_I2C_LCD/LiquidCrystal_I2C.h:53:4: error: initializing argument 3 of 'LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t, uint8_t, t_backlighPol)' [-fpermissive]
LiquidCrystal_I2C (uint8_t lcd_Addr, uint8_t backlighPin, t_backlighPol pol);
^
D:\Ameba_IDE\hardware\arduino\ameba\libraries\Ameba_I2C_LCD/LiquidCrystal_I2C.h: In function 'void setup()':
D:\Ameba_IDE\hardware\arduino\ameba\libraries\Ameba_I2C_LCD/LiquidCrystal_I2C.h:154:9: error: 'int LiquidCrystal_I2C::init()' is private
int init();
^
sketch_jan11a.ino:10:12: error: within this context
編譯時發生錯誤

 

 

可以想問一下,如何解決

謝謝您

 

brucetsao

yves 回答了