女人自慰AV免费观看内涵网,日韩国产剧情在线观看网址,神马电影网特片网,最新一级电影欧美,在线观看亚洲欧美日韩,黄色视频在线播放免费观看,ABO涨奶期羡澄,第一导航fulione,美女主播操b

電子發(fā)燒友App

硬聲App

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

完善資料讓更多小伙伴認識你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示
創(chuàng)作
電子發(fā)燒友網(wǎng)>電子資料下載>單片機>arduino1602顯示屏例程

arduino1602顯示屏例程

2018-01-09 | rar | 23KB | 次下載 | 1積分

資料介紹

初學(xué)者可以參考的1602顯示屏程序:

  1602LCD主要技術(shù)參數(shù)

  顯示容量為16×2個字符;

  芯片工作電壓為4.5~5.5V;

  工作電流為2.0mA(5.0V);

  模塊最佳工作電壓為5.0V;

  字符尺寸為2.95×4.35(W×H)mm。

  arduino1602顯示屏例程

代碼如下

  int DI = 12;

  int RW = 11;

  int DB[] = {3, 4, 5, 6, 7, 8, 9, 10};//使用數(shù)組來定義總線需要的管腳

  int Enable = 2;

  void LcdCommandWrite(int value) {

  // 定義所有引腳

  int i = 0;

  for (i=DB[0]; i 《= DI; i++) //總線賦值

  {

  digitalWrite(i,value & 01);//因為1602液晶信號識別是D7-D0(不是D0-D7),這里是用來反轉(zhuǎn)信號。

  value 》》= 1;

  }

  digitalWrite(Enable,LOW);

  delayMicroseconds(1);

  digitalWrite(Enable,HIGH);

  delayMicroseconds(1); // 延時1ms

  digitalWrite(Enable,LOW);

  delayMicroseconds(1); // 延時1ms

  }

  void LcdDataWrite(int value) {

  // 定義所有引腳

  int i = 0;

  digitalWrite(DI, HIGH);

  digitalWrite(RW, LOW);

  for (i=DB[0]; i 《= DB[7]; i++) {

  digitalWrite(i,value & 01);

  value 》》= 1;

  }

  digitalWrite(Enable,LOW);

  delayMicroseconds(1);

  digitalWrite(Enable,HIGH);

  delayMicroseconds(1);

  digitalWrite(Enable,LOW);

  delayMicroseconds(1); // 延時1ms

  }

  void setup (void) {

  int i = 0;

  for (i=Enable; i 《= DI; i++) {

  pinMode(i,OUTPUT);

  }

  delay(100);

  // 短暫的停頓后初始化LCD

  // 用于LCD控制需要

  LcdCommandWrite(0x38); // 設(shè)置為8-bit接口,2行顯示,5x7文字大小

  delay(64);

  LcdCommandWrite(0x38); // 設(shè)置為8-bit接口,2行顯示,5x7文字大小

  delay(50);

  LcdCommandWrite(0x38); // 設(shè)置為8-bit接口,2行顯示,5x7文字大小

  delay(20);

  LcdCommandWrite(0x06); // 輸入方式設(shè)定

  // 自動增量,沒有顯示移位

  delay(20);

  LcdCommandWrite(0x0E); // 顯示設(shè)置

  // 開啟顯示屏,光標顯示,無閃爍

  delay(20);

  LcdCommandWrite(0x01); // 屏幕清空,光標位置歸零

  delay(100);

  LcdCommandWrite(0x80); // 顯示設(shè)置

  // 開啟顯示屏,光標顯示,無閃爍

  delay(20);

  }

  void loop (void) {

  LcdCommandWrite(0x01); // 屏幕清空,光標位置歸零

  delay(10);

  LcdCommandWrite(0x80+3);

  delay(10);

  // 寫入歡迎信息

  LcdDataWrite(‘W’);

  LcdDataWrite(‘e’);

  LcdDataWrite(‘l’);

  LcdDataWrite(‘c’);

  LcdDataWrite(‘o’);

  LcdDataWrite(‘m’);

  LcdDataWrite(‘e’);

  LcdDataWrite(‘ ’);

  LcdDataWrite(‘t’);

  LcdDataWrite(‘o’);

  delay(10);

  LcdCommandWrite(0xc0+1); // 定義光標位置為第二行第二個位置

  delay(10);

  LcdDataWrite(‘g’);

  LcdDataWrite(‘e’);

  LcdDataWrite(‘e’);

  LcdDataWrite(‘k’);

  LcdDataWrite(‘-’);

  LcdDataWrite(‘w’);

  LcdDataWrite(‘o’);

  LcdDataWrite(‘r’);

  LcdDataWrite(‘k’);

  LcdDataWrite(‘s’);

  LcdDataWrite(‘h’);

  LcdDataWrite(‘o’);

  LcdDataWrite(‘p’);

  delay(5000);

  LcdCommandWrite(0x01); // 屏幕清空,光標位置歸零

  delay(10);

  LcdDataWrite(‘I’);

  LcdDataWrite(‘ ’);

  LcdDataWrite(‘a(chǎn)’);

  LcdDataWrite(‘m’);

  LcdDataWrite(‘ ’);

  LcdDataWrite(‘h’);

  LcdDataWrite(‘o’);

  LcdDataWrite(‘n’);

  LcdDataWrite(‘g’);

  LcdDataWrite(‘y’);

  LcdDataWrite(‘i’);

  delay(3000);

  LcdCommandWrite(0x02); //設(shè)置模式為新文字替換老文字,無新文字的地方顯示不變。

  delay(10);

  LcdCommandWrite(0x80+5); //定義光標位置為第一行第六個位置

  delay(10);

  LcdDataWrite(‘t’);

  LcdDataWrite(‘h’);

  LcdDataWrite(‘e’);

  LcdDataWrite(‘ ’);

  LcdDataWrite(‘a(chǎn)’);

  LcdDataWrite(‘d’);

  LcdDataWrite(‘m’);

  LcdDataWrite(‘i’);

  LcdDataWrite(‘n’);

  delay(5000);

  }

  int DI = 12;

  int RW = 11;

  int DB[] = {3, 4, 5, 6, 7, 8, 9, 10};//使用數(shù)組來定義總線需要的管腳

  int Enable = 2;

  

  void LcdCommandWrite(int value) {

   // 定義所有引腳

   int i = 0;

   for (i=DB[0]; i 《= DI; i++) //總線賦值

  {

   digitalWrite(i,value & 01);//因為1602液晶信號識別是D7-D0(不是D0-D7),這里是用來反轉(zhuǎn)信號。

   value 》》= 1;

   }

   digitalWrite(Enable,LOW);

   delayMicroseconds(1);

   digitalWrite(Enable,HIGH);

   delayMicroseconds(1); // 延時1ms

   digitalWrite(Enable,LOW);

   delayMicroseconds(1); // 延時1ms

  }

  

  void LcdDataWrite(int value) {

   // 定義所有引腳

   int i = 0;

   digitalWrite(DI, HIGH);

   digitalWrite(RW, LOW);

   for (i=DB[0]; i 《= DB[7]; i++) {

   digitalWrite(i,value & 01);

   value 》》= 1;

   }

   digitalWrite(Enable,LOW);

   delayMicroseconds(1);

   digitalWrite(Enable,HIGH);

   delayMicroseconds(1);

   digitalWrite(Enable,LOW);

   delayMicroseconds(1); // 延時1ms

  }

  

  void setup (void) {

   int i = 0;

   for (i=Enable; i 《= DI; i++) {

   pinMode(i,OUTPUT);

  }

   delay(100);

   // 短暫的停頓后初始化LCD

   // 用于LCD控制需要

   LcdCommandWrite(0x38); // 設(shè)置為8-bit接口,2行顯示,5x7文字大小

   delay(64);

   LcdCommandWrite(0x38); // 設(shè)置為8-bit接口,2行顯示,5x7文字大小

   delay(50);

   LcdCommandWrite(0x38); // 設(shè)置為8-bit接口,2行顯示,5x7文字大小

   delay(20);

   LcdCommandWrite(0x06); // 輸入方式設(shè)定

   // 自動增量,沒有顯示移位

   delay(20);

   LcdCommandWrite(0x0E); // 顯示設(shè)置

   // 開啟顯示屏,光標顯示,無閃爍

   delay(20);

   LcdCommandWrite(0x01); // 屏幕清空,光標位置歸零

   delay(100);

   LcdCommandWrite(0x80); // 顯示設(shè)置

   // 開啟顯示屏,光標顯示,無閃爍

   delay(20);

  }

  

  void loop (void) {

   LcdCommandWrite(0x01); // 屏幕清空,光標位置歸零

   delay(10);

   LcdCommandWrite(0x80+3);

   delay(10);

   // 寫入歡迎信息

   LcdDataWrite(‘W’);

   LcdDataWrite(‘e’);

   LcdDataWrite(‘l’);

   LcdDataWrite(‘c’);

   LcdDataWrite(‘o’);

   LcdDataWrite(‘m’);

   LcdDataWrite(‘e’);

   LcdDataWrite(‘ ’);

   LcdDataWrite(‘t’);

   LcdDataWrite(‘o’);

   delay(10);

   LcdCommandWrite(0xc0+1); // 定義光標位置為第二行第二個位置

   delay(10);

   LcdDataWrite(‘g’);

   LcdDataWrite(‘e’);

  LcdDataWrite(‘e’);

   LcdDataWrite(‘k’);

   LcdDataWrite(‘-’);

   LcdDataWrite(‘w’);

   LcdDataWrite(‘o’);

   LcdDataWrite(‘r’);

   LcdDataWrite(‘k’);

   LcdDataWrite(‘s’);

   LcdDataWrite(‘h’);

   LcdDataWrite(‘o’);

   LcdDataWrite(‘p’);

   delay(5000);

   LcdCommandWrite(0x01); // 屏幕清空,光標位置歸零

   delay(10);

   LcdDataWrite(‘I’);

   LcdDataWrite(‘ ’);

   LcdDataWrite(‘a(chǎn)’);

   LcdDataWrite(‘m’);

   LcdDataWrite(‘ ’);

   LcdDataWrite(‘h’);

   LcdDataWrite(‘o’);

   LcdDataWrite(‘n’);

   LcdDataWrite(‘g’);

   LcdDataWrite(‘y’);

   LcdDataWrite(‘i’);

   delay(3000);

   LcdCommandWrite(0x02); //設(shè)置模式為新文字替換老文字,無新文字的地方顯示不變。

   delay(10);

   LcdCommandWrite(0x80+5); //定義光標位置為第一行第六個位置

   delay(10);

   LcdDataWrite(‘t’);

   LcdDataWrite(‘h’);

   LcdDataWrite(‘e’);

   LcdDataWrite(‘ ’);

   LcdDataWrite(‘a(chǎn)’);

   LcdDataWrite(‘d’);

   LcdDataWrite(‘m’);

   LcdDataWrite(‘i’);

   LcdDataWrite(‘n’);

   delay(5000);

  }

下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1TC358743XBG評估板參考手冊
  2. 1.36 MB  |  330次下載  |  免費
  3. 2開關(guān)電源基礎(chǔ)知識
  4. 5.73 MB  |  6次下載  |  免費
  5. 3100W短波放大電路圖
  6. 0.05 MB  |  4次下載  |  3 積分
  7. 4嵌入式linux-聊天程序設(shè)計
  8. 0.60 MB  |  3次下載  |  免費
  9. 5基于FPGA的光纖通信系統(tǒng)的設(shè)計與實現(xiàn)
  10. 0.61 MB  |  2次下載  |  免費
  11. 651單片機窗簾控制器仿真程序
  12. 1.93 MB  |  2次下載  |  免費
  13. 751單片機大棚環(huán)境控制器仿真程序
  14. 1.10 MB  |  2次下載  |  免費
  15. 8基于51單片機的RGB調(diào)色燈程序仿真
  16. 0.86 MB  |  2次下載  |  免費

本月

  1. 1OrCAD10.5下載OrCAD10.5中文版軟件
  2. 0.00 MB  |  234315次下載  |  免費
  3. 2555集成電路應(yīng)用800例(新編版)
  4. 0.00 MB  |  33564次下載  |  免費
  5. 3接口電路圖大全
  6. 未知  |  30323次下載  |  免費
  7. 4開關(guān)電源設(shè)計實例指南
  8. 未知  |  21549次下載  |  免費
  9. 5電氣工程師手冊免費下載(新編第二版pdf電子書)
  10. 0.00 MB  |  15349次下載  |  免費
  11. 6數(shù)字電路基礎(chǔ)pdf(下載)
  12. 未知  |  13750次下載  |  免費
  13. 7電子制作實例集錦 下載
  14. 未知  |  8113次下載  |  免費
  15. 8《LED驅(qū)動電路設(shè)計》 溫德爾著
  16. 0.00 MB  |  6653次下載  |  免費

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935054次下載  |  免費
  3. 2protel99se軟件下載(可英文版轉(zhuǎn)中文版)
  4. 78.1 MB  |  537796次下載  |  免費
  5. 3MATLAB 7.1 下載 (含軟件介紹)
  6. 未知  |  420026次下載  |  免費
  7. 4OrCAD10.5下載OrCAD10.5中文版軟件
  8. 0.00 MB  |  234315次下載  |  免費
  9. 5Altium DXP2002下載入口
  10. 未知  |  233046次下載  |  免費
  11. 6電路仿真軟件multisim 10.0免費下載
  12. 340992  |  191185次下載  |  免費
  13. 7十天學(xué)會AVR單片機與C語言視頻教程 下載
  14. 158M  |  183279次下載  |  免費
  15. 8proe5.0野火版下載(中文版免費下載)
  16. 未知  |  138040次下載  |  免費