资源简介
打包了LiquidCrystal_I2C_h,同时包含proteus下的arduino实现IIC的1602的操作工程文件及代码;而且经过严格测试保证能用
代码片段和文件信息
/**********************************************
LiquidCrystal_I2C
last updated on 21/12/2011
Tim Starling Fix the reset bug (Thanks Tim)
www.yfrobot.com
**********************************************/
#include “LiquidCrystal_I2C.h“
#include
#if defined(ARDUINO) && ARDUINO >= 100
#include “Arduino.h“
#define printIIC(args) Wire.write(args)
inline size_t LiquidCrystal_I2C::write(uint8_t value) {
send(value Rs);
return 1;
}
#else
#include “WProgram.h“
#define printIIC(args) Wire.send(args)
inline void LiquidCrystal_I2C::write(uint8_t value) {
send(value Rs);
}
#endif
#include “Wire.h“
// When the display powers up it is configured as follows:
//
// 1. Display clear
// 2. Function set:
// DL = 1; 8-bit interface data
// N = 0; 1-line display
// F = 0; 5x8 dot character font
// 3. Display on/off control:
// D = 0; Display off
// C = 0; Cursor off
// B = 0; blinking off
// 4. Entry mode set:
// I/D = 1; Increment by 1
// S = 0; No shift
//
// Note however that resetting the Arduino doesn‘t reset the LCD so we
// can‘t assume that its in that state when a sketch starts (and the
// LiquidCrystal constructor is called).
LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t lcd_Addruint8_t lcd_colsuint8_t lcd_rows)
{
_Addr = lcd_Addr;
_cols = lcd_cols;
_rows = lcd_rows;
_backlightval = LCD_NOBACKLIGHT;
}
void LiquidCrystal_I2C::init(){
init_priv();
}
void LiquidCrystal_I2C::init_priv()
{
Wire.begin();
_displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS;
begin(_cols _rows);
}
void LiquidCrystal_I2C::begin(uint8_t cols uint8_t lines uint8_t dotsize) {
if (lines > 1) {
_displayfunction |= LCD_2LINE;
}
_numlines = lines;
// for some 1 line displays you can select a 10 pixel high font
if ((dotsize != 0) && (lines == 1)) {
_displayfunction |= LCD_5x10DOTS;
}
// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!
// according to datasheet we need at least 40ms after power rises above 2.7V
// before sending commands. Arduino can turn on way befer 4.5V so we‘ll wait 50
delay(50);
// Now we pull both RS and R/W low to begin commands
expanderWrite(_backlightval); // reset expanderand turn backlight off (Bit 8 =1)
delay(1000);
//put the LCD into 4 bit mode
// this is according to the hitachi HD44780 datasheet
// figure 24 pg 46
// we start in 8bit mode try to set 4 bit mode
write4bits(0x03 << 4);
delayMicroseconds(4500); // wait min 4.1ms
// second try
write4bits(0x03 << 4);
delayMicroseconds(4500); // wait min 4.1ms
// third go!
write4bits(0x03 << 4);
delayMicroseconds(150);
// finally set to 4-bit interface
write4bits(0x02 << 4);
// set # lines font size etc.
command(LCD_FUNCTIONSET | _displayfunction);
// turn the display on with no cursor or blinking default
_displaycontrol = L
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-03-31 21:33 lcd1602_proteus_arduino仿真\LiquidCrystal_I2C\
文件 8758 2015-12-23 15:55 lcd1602_proteus_arduino仿真\LiquidCrystal_I2C\LiquidCrystal_I2C.cpp
文件 3626 2013-12-26 19:25 lcd1602_proteus_arduino仿真\LiquidCrystal_I2C\LiquidCrystal_I2C.h
文件 1095 2009-09-12 00:15 lcd1602_proteus_arduino仿真\LiquidCrystal_I2C\keywords.txt
文件 28173 2019-03-31 21:16 lcd1602_proteus_arduino仿真\arduino_1602LCD_pcf8574.pdsprj
目录 0 2019-03-31 21:33 lcd1602_proteus_arduino仿真\
相关资源
- 频率电压电流仿真检测_Proteus仿真单片
- proteus纯数字电路数字钟
- proteus中51单片机制作的计算器
- 走马灯,流水灯,KEIL,PROTEUS
- ADC0832 Proteus仿真及C51驱动源码
- 74HC165 并转串 例程,带proteus仿真
- 51单片机PROTEUS超值仿真 附源程序
- 4511做的八路抢答器 proteus
- 可调时钟+闹钟——基于DS1302
- GPS卫星定位proteus仿真.rar
- 51单片机多机通信PROTEUS仿真
- Proteus 7.10的汉化文件
- 基于DAC0832的DDS信号发生器报告+原理图
- 4*4矩阵键盘+1602显示的proteus仿真
- 单片机课程设计—电子时钟Proteus
- 单片机双机通讯proteus仿真
- ADC0809 双通道采集 proteus数码管显示
- 用51单片机实现小车循迹和LCD显示
- 光耦隔离控制继电器驱动直流电机p
- 8086实验IO控制灯亮Proteus实验报告
- 基于proteus的波形发生器设计
- 数字电压表基于proteus的仿真
- 多层电梯的 proteus仿真
- AD1674 proteus仿真
- FPGA驱动LCD1602完整工程
- LCD1602 PCB封装库
- 基于89C51的等精度频率计LCD1602显示基
- 51单片机pwm波,lcd1602,l298n带prtues仿真
- 数控直流稳压电源 Proteus
- 密码锁 Proteus
评论
共有 条评论