Arduino LCD12864 I2C接口中文液晶

Arduino LCD12864 I2C接口中文液晶

/*--------Arduino Uno connection to LCD-----------------------------------------------
       LCD Module                  Arduino Uno

       GND-------------------------GND
       VDD-------------------------5.0V
       RST(Floating)
       SCL-------------------------A5(PC5)
       SDA-------------------------A4(PC4)
       BUSY------------------------A3(PC3)
       A1(Floating)
       A0(Floating)

  -------------------------------------------------------------------------------------*/

#include <RSCG12864B.h>

// 需要将显示的GBK汉字的进行十六进制转换
char chn[] = {0xbd, 0xaf, 0xd6, 0xc7, 0xea, 0xbb, 0};	// 最后加0,为了让显示函数能判定何时结束

void setup() {
  // put your setup code here, to run once:
  RSCG12864B.begin();
  RSCG12864B.brightness(10);
}

void loop() {

  RSCG12864B.clear();
  RSCG12864B.clear();
  RSCG12864B.print_string_16_xy(0, 0, chn);

  RSCG12864B.print_string_12_xy(0, 20, "http://chanpinxue.cn");

  delay(8000);
  RSCG12864B.clear();
  RSCG12864B.font_revers_on();			//反白操作
  RSCG12864B.print_string_12_xy(25, 0, "Built-in font");
  RSCG12864B.font_revers_off();			//关闭反白

  RSCG12864B.print_string_5x7_xy(3, 15, "5*7 ASCII 0123456789");
  RSCG12864B.print_string_5x7_xy(3, 25, "5*7 ASCII ABCDEabcde");
  RSCG12864B.print_string_12_xy(20, 35, "6*12/12*12 FONT");
  RSCG12864B.print_string_16_xy(5, 48, "8*16/16*16 FONT");
  delay(3000);

}

【2024-04-17更新】

LCD 12864 I2C 中文液晶的Fritzing 元件

4条评论

发表回复

您的电子邮箱地址不会被公开。