jason1986 发表于 2014-8-29 17:40:34

新手刚入门在论坛学习了知识,做了一个1602 helloworld,继续学习!!

本帖最后由 jason1986 于 2014-8-29 17:43 编辑

1602LED,4线接法,输出helloworld,代码简单,如下:

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
lcd.begin(16, 2);
lcd.print("hello, world!");
}
void loop() {
}

接线步骤用官方的helloworld接法:

The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)

zoologist 发表于 2014-8-29 19:15:37

不错,有机会再试试 i2c的 1602吧 更省线

潇洒哥 发表于 2014-8-29 19:53:41

楼主用了1602的8线接法,建议使用I2C的串行模块,省好多接口,只需4线

jason1986 发表于 2014-8-29 23:46:41

zoologist 发表于 2014-8-29 19:15 static/image/common/back.gif
不错,有机会再试试 i2c的 1602吧 更省线

好的!必须试一试。。

jason1986 发表于 2014-8-29 23:48:41

潇洒哥 发表于 2014-8-29 19:53 static/image/common/back.gif
楼主用了1602的8线接法,建议使用I2C的串行模块,省好多接口,只需4线

需要另外增加模块吗?

潇洒哥 发表于 2014-8-30 08:39:57

需要另外增加模块吗?
嗯,需要,不贵,就几块钱我的1602和2004都用的I2C模块

风中的落叶 发表于 2014-9-3 14:02:37

潇洒哥 发表于 2014-8-30 08:39 static/image/common/back.gif
嗯,需要,不贵,就几块钱我的1602和2004都用的I2C模块

我想请问用I2C怎么来做1602,而且,应该用串行来写程序吧,只有数据和时钟接口

潇洒哥 发表于 2014-9-3 19:56:39

是这个模块,焊接上就行,接到1602上无需做修改,接到2004上需要把地址改成0x27
声明,我不是推销的,也不是某宝店主,我只是晶莹透亮的爱好者一枚,看看这个
http://detail.tmall.com/item.htm?spm=a230r.1.14.57.GgdGM0&id=38022506557
页: [1]
查看完整版本: 新手刚入门在论坛学习了知识,做了一个1602 helloworld,继续学习!!