I2C LCD

    內容表格
    沒有標頭

    版本為 08:34, 6 Oct 2024

    到這個版本。

    返回到 版本存檔.

    查閱目前版本

    從淘寶買來的 I2C LCD (http://item.taobao.com/item.htm?spm=a230r.1.10.209&id=18859272993):

    2012-09-02_13h50_56.png

     

    特性:

    • 16x2 LCD 藍底白字,有背光
    • 走 I2C 控制,設備地址為 0x27
    • 可調整螢幕顯示對比
    • 5V 供電,相容於 Arduino

     

    接線方法:

    20120902_142943.jpg

     

    SDA - 接 Arduino 的 Analog Pin 4 (Atmega 為 Pin 20)
    SCL - 接 Arduino 的 Analog Pin 5 (Atmega 為 Pin 21)
    GND - 接 GND
    VCC - 接 +5V

     

    I2C LCD 函式庫:

    下載地址: http://arduino-info.wikispaces.com/f..._I2C1602V1.zip

    附件有一份 copy。

     

    範例程式:

    #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()
    {
    }

     

     

    Powered by MindTouch Core