资源简介
打包了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仿真\
相关资源
- 51单片机PWM程序,占空比、周期可调整
- proteus仿真 AT89C51输出各种波形
- 00
- [免费]msp430f149控制PS2键盘并用1602显示
- 51单片机读取温度数据存储到SD卡中并
- 【单片机】51单片机数码管显示万年历
- vhdl与lcd1602实现的多控制电子钟
- proteus_24C08—有注释(proteus里面使用的
- DS18B20分布式多点测温的Proteus仿真
- ADC0809数字电压表 LCD1602显示 汇编程序
- 基于proteus的单片机仿真--交通灯控制
- 带时间温度显示的室内灯光控制系统
- 51多机通信(内附Proteus及.hex文件)
- IIC proteus仿真实验
- 8086交通灯 Proteus原理图及程序
- 单片机仿真软件proteus6.7免安装绿色版
- 关于proteus仿真arm7出现错误的问题
- 基于PROTEUS的ARM7显示系统设计与仿真实
-
Hollow fibre ba
sed Liquid-liquid-liquid mic - Cyclic Voltammetry and Thermodynamic Propertie
- STM32+1602液晶proteus仿真.zip
- AT89C51+ADC0808 PROTEUS仿真
- 单片机驱动4相步进电机proteus仿真
- proteus元件库对照表 (整理清晰)
- 微机原理 十字路口交通灯控制 prot
- 中央空调室内智能温控器设计论文、
- 基于51单片机的交通灯设计
- 基于AT89C51的十字路口交通灯设计pro
- Proteus单片机仿真大全几百个part4
- Proteus升压电路仿真
评论
共有 条评论