91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 20KB
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2021-05-10
  • 語言: 其他
  • 標(biāo)簽: Arduino??

資源簡(jiǎn)介

Arduino LiquidCrystal_I2C庫(kù)

資源截圖

代碼片段和文件信息

//DFRobot.com
#include?“LiquidCrystal_I2C.h“
#include?
#include?“WProgram.h“?
#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
delayMicroseconds(50000);?
??
//?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);
delayMicroseconds(4500);?//?wait?min?4.1ms

//?second?try
write4bits(0x03);
delayMicroseconds(4500);?//?wait?min?4.1ms

//?third?go!
write4bits(0x03);?
delayMicroseconds(150);

//?finally?set?to?4-bit?interface
write4bits(0x02);?


//?set?#?lines?font?size?etc.
command(LCD_FUNCTIONSET?|?_displayfunction);??

//?turn?the?display?on?with?no?cursor?or?blinking?default
_displaycontrol?=?LCD_DISPLAYON?|?LCD_CURSOROFF?|?LCD_blinkOFF;
display();

//?clear?it?off
clear();

//?Initialize?to?default?text?direction?(for?roman?languages)
_displaymode?=?LCD_ENTRYLEFT?|?LCD_ENTRYSHIFTDECREMENT;

//?set?the?entry?mode
command(LCD_ENTRYMODESET?|?_displaymode);

home();
??
}



/**********?high?level?commands?for?the?user!?*/
void?LiquidCrystal_I2C::clear(){
command(LCD_CLEARDISPLAY);//?clear?display?set?cursor?position?to?zero
delayMicroseconds(2000);??//?this?command?takes?a?long?time!
}

void?LiquidCrystal_I2C::

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-11-02?08:30??LiquidCrystal_I2C\
?????文件????????8280??2011-05-06?17:59??LiquidCrystal_I2C\LiquidCrystal_I2C.cpp
?????文件????????3344??2010-05-27?02:49??LiquidCrystal_I2C\LiquidCrystal_I2C.h
?????文件???????41564??2009-09-12?00:15??LiquidCrystal_I2C\LiquidCrystal_I2C.o
?????目錄???????????0??2012-11-02?08:30??LiquidCrystal_I2C\examples\
?????目錄???????????0??2012-11-02?08:30??LiquidCrystal_I2C\examples\CustomChars\
?????文件????????1487??2010-05-27?02:53??LiquidCrystal_I2C\examples\CustomChars\CustomChars.pde
?????目錄???????????0??2012-11-02?08:30??LiquidCrystal_I2C\examples\HelloWorld\
?????文件?????????360??2010-05-27?02:53??LiquidCrystal_I2C\examples\HelloWorld\HelloWorld.pde
?????目錄???????????0??2012-11-02?08:30??LiquidCrystal_I2C\examples\LCD2004HelloWorld\
?????文件?????????607??2011-08-05?12:42??LiquidCrystal_I2C\examples\LCD2004HelloWorld\LCD2004HelloWorld.pde
?????目錄???????????0??2012-11-02?08:30??LiquidCrystal_I2C\examples\SerialDisplay\
?????文件?????????787??2010-05-27?02:53??LiquidCrystal_I2C\examples\SerialDisplay\SerialDisplay.pde
?????文件????????1095??2009-09-12?00:15??LiquidCrystal_I2C\keywords.txt

評(píng)論

共有 條評(píng)論