求助大佬LCD问题-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

楼主: zz1018

[未解决] 求助大佬LCD问题

[复制链接]
发表于 2020-2-27 16:33 | 显示全部楼层
1,用什么接口,就用什么库,4口lcd,就用LiquidCrystal_I2C,16个接口的lcd就用LiquidCrystal库。
2,最好贴出你的设备图片,因为lcd有接口1在外面,有的1接口在里面。其实都无所谓,接口旁边都有字的,看字就行了。
3,贴一个例程,按照例程示意接线,一般都能成功。
[mw_shl_code=arduino,true]/*
  LiquidCrystal Library - Blink

Demonstrates the use a 16x2 LCD display.  The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.

This sketch prints "Hello World!" to the LCD and makes the
cursor block blink.

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)

Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe
modified 7 Nov 2016
by Arturo Guadalupi

This example code is in the public domain.

http://www.arduino.cc/en/Tutorial/LiquidCrystalBlink

*/

// include the library code:
#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("hello, world!");
}

void loop() {
  // Turn off the blinking cursor:
  lcd.noBlink();
  delay(3000);
  // Turn on the blinking cursor:
  lcd.blink();
  delay(3000);
}

[/mw_shl_code]
接口顺序是这个
[mw_shl_code=arduino,true]const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);[/mw_shl_code]
 楼主| 发表于 2021-2-25 15:41 | 显示全部楼层
eagler8 发表于 2020-2-9 07:36
早上好

我使用的是1.8.10,最新版本是1.8.11

在?
我运行了一下
现在显示找不到lcd
 楼主| 发表于 2021-2-25 15:48 | 显示全部楼层
eagler8 发表于 2020-2-9 07:38
运行烧录的程序,打开串口监视器,查看输出结果

还在吗?
通过了验证,并且上传成功,但是不能显示
代码如下
  1. #include <LiquidCrystal.h>

  2. // initialize the library by associating any needed LCD interface pin
  3. // with the arduino pin number it is connected to
  4. const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
  5. LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

  6. void setup() {
  7.   // set up the LCD's number of columns and rows:
  8.   lcd.begin(16, 2);
  9.   // Print a message to the LCD.
  10.   lcd.print("hello, world!");
  11. }

  12. void loop() {
  13.   // Turn off the blinking cursor:
  14.   lcd.noBlink();
  15.   delay(3000);
  16.   // Turn on the blinking cursor:
  17.   lcd.blink();
  18.   delay(3000);
  19. }
复制代码


发表于 2021-2-25 20:07 | 显示全部楼层
zz1018 发表于 2021-2-25 15:48
还在吗?
通过了验证,并且上传成功,但是不能显示
代码如下

估计是硬件接线没有接对,截个图看下
 楼主| 发表于 2021-2-25 21:07 | 显示全部楼层
eagler8 发表于 2021-2-25 20:07
估计是硬件接线没有接对,截个图看下

截个图?
 楼主| 发表于 2021-2-25 21:11 | 显示全部楼层
运行了程序后RGB一直闪
 楼主| 发表于 2021-2-25 21:12 | 显示全部楼层
应该是引脚的问题
 楼主| 发表于 2021-2-25 21:14 | 显示全部楼层
eagler8 发表于 2021-2-25 20:07
估计是硬件接线没有接对,截个图看下

RGB一直闪
应该是引脚的问题

 楼主| 发表于 2021-2-25 21:15 | 显示全部楼层
eagler8 发表于 2021-2-25 20:07
估计是硬件接线没有接对,截个图看下

我找这个板的电路图就是找不到
 楼主| 发表于 2021-2-25 21:17 | 显示全部楼层
eagler8 发表于 2021-2-25 20:07
估计是硬件接线没有接对,截个图看下

加我QQ聊
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-29 16:35 , Processed in 0.075044 second(s), 13 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表