arduino连接LCD1602A

本文介绍了如何使用Arduino连接4位和8位LCD1602显示器,包括接线方法和使用LiquidCrystal库的步骤,提供相关参考资料。
摘要由CSDN通过智能技术生成
  • 接线图
[caption id="attachment_1183" align="alignnone" width="1108"] LCD1602A接线图(4位) LCD1602A接线图(4位)[/caption] 132950fbbbolz4q0qs1bbo
  • 4位接线法
[codesyntax lang="cpp"]
/**
* VSS GND
* VDD 5V
* V0  GND
* RS  12
* RW  11
* E   10
* D4  9
* D5  8
* D6  7
* D7  6
* A  V5
* K  GND
* from http://surenpi.com
* created 2015/3/23
*/
int LCD1602_RS=12;
int LCD1602_RW=11;
int LCD1602_EN=10;
int DB[] = { 6, 7, 8, 9};

char str1[]="Welcome to";
char str2[]="surenpi";
char str3[]="find me";
char str4[]="surenpi.com";
 
void LCD_Command_Write(int command)
{
  int i,temp;
  digitalWrite( LCD1602_RS,LOW);
  digitalWrite( LCD1602_RW,LOW);
  digitalWrite( LCD1602_EN,LOW);
 
  temp=command & 0xf0;
  for (i=DB[0]; i <= 9; i++)
  {
     digitalWrite(i,temp & 0x80);
     temp <<= 1;
  }
   
  digitalWrite( LCD1602_EN,HIGH);
  delayMicroseconds(1);
  digitalWrite( LCD1602_EN,LOW);
   
  temp=(command & 0x0f)<<4;
  for (i=DB[0]; i <= 9; i++)
  {
     digitalWrite(i,temp & 0x80);
     temp <<
  • 3
    点赞
  • 32
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值