|
楼主 |
发表于 2013-11-5 10:30:19
|
显示全部楼层
上面的附件里有驱动库和范例程序,我修改了一下把几个图标显示出来了,代码如下:- /*7:rs
- 6:e
- 5:d4
- 4:d5
- 3:d6
- 2:d7
- rw connect to gnd
- */
- #include <lcd4bit.h>
- // initialize the library with the numbers of the interface pins
- LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
- void setup() {
- // set up the LCD's number of columns and rows:
- lcd.begin(16, 2);
- delay(5);
- lcd.clear();
- delay(5);
- lcd.setCursor(1, 0);
- delay(1);
- // Print a message to the LCD.
- lcd.print("hello,world!");
- lcd.setCursor(1, 1);
- lcd.print("test");
- delay(1);
- lcd.command(0x28 | 0x04); //设定为图表显示模式
- //delay(10);
- // lcd.command(0x40+0x05);
- // delay(10);
- // lcd.write(0xff);
- //delay(10);
-
- lcd.lcd_Icon(0x00,0x18);//天线信号
- lcd.lcd_Icon(0x01,0x09);//天线信号第五格
- lcd.lcd_Icon(0x04,0x05);//电池
- lcd.lcd_Icon(0x05,0xff);//menu
- lcd.lcd_Icon(0x09,0xff);//闹钟
- lcd.lcd_Icon(0x0b,0xff);//书本
- lcd.lcd_Icon(0x0d,0xff);//信封
- lcd.lcd_Icon(0x0f,0xff);//电话
- //lcd.lcd_Icon(0x03,0xff);
- lcd.command(0x28); //设定为字符显示模式
- //delay(1000);
- //lcd.setCursor(1, 0);
- //lcd.setRE();
- //lcd.lcd_Icon(0x09,0x15);
- //lcd.write(0x01);
- }
- void loop() {
- //set the cursor to column 0, line 1
- //(note: line 1 is the second row, since counting begins with 0):
- //lcd.clear();
- //lcd.setCursor(0, 1);
- //print the number of seconds since reset:
- //lcd.print(millis()/1000);
-
- }
复制代码 |
|