使文本显示在 I2C LCD 上 [英] Getting text to show up on an I2C LCD

查看:20
本文介绍了使文本显示在 I2C LCD 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是电子产品的新手,正在尝试让我的 1602 LCD 与 I2C 适配器配合使用.我的背光灯正常工作,但无法显示文本.这是我当前的代码:

I am new to electronics, and trying to get my 1602 LCD to work with an I2C adapter. I got my backlight to work, but I can't get text to show. This is my current code:

#include <LiquidCrystal_I2C.h>
#include <Wire.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
    lcd.init();
    lcd.backlight();
    lcd.setCursor(5, 0);
    lcd.print("HELLO");
}

void loop() {
    lcd.backlight();
    delay(2000);
    lcd.noBacklight();
    delay(2000);
}

我使用 scanner 检查了 I2C 地址,结果为 0x27.

I checked for the I2C address with the scanner and it is 0x27.

我在谷歌上搜索了一下,然后通过了这篇帖子,有人发布了这个帖子:

I Googled a bit and came past this post where someone posted this:

简单测试

将 +5v/GND 施加到 LCD - 显示器 - 然后将背景 LED 电源(有时标记为 A/K)施加到 LCD 模块.

Apply +5v / GND to LCD - display - and than apply background LED power ( sometime marked A/K) to the LCD module.

此通电测试不需要其他连接(数据等).

No other connections ( data etc.) are necessary for this power up test.

你应该能够识别所有的颤振字段,但连接对比罐会更容易.

You should be able to discern ALL chatterers fields, but connecting contrast pot will make it easier.

它可能不完全可见,但模块将在加电时初始化(内部)并且所有字符字段都应显示.

It MAY not be totally visible but the module will initialize ( internally) on power up and ALL characters fields should show.

当然现在你知道你基本上需要三个力量"与 LCD 的连接 - LCD 本身、对比度和背光.

Of course by now you know you need basically three "power" connections to the LCD - LCD itself, contrast and backlight.

确实看起来缺少主 LCD 电源 - 因此无法处理/显示智能数据.

Sure looks as the main LCD power is missing - hence no intelligent data can be processed / displayed.

我也做了这个测试并得出了这些结果:

I did this test aswell and came to these results:

  • 当为背光提供 5V 电压时,它会变亮.
  • 当为背光和 LCD 本身提供 5V 电压时,背光会变暗,但没有其他显示.

然后我不小心把 I2C 适配器颠倒了,但这确实给了我文本块.

I then accidentally put the I2C adapter upside down, but that did give me the text blocks.

我怎样才能显示文本?我目前做错了什么?

How could I get the text to show? What am I currently doing wrong?

推荐答案

小问题,你试过修剪锅吗?我怀疑这设置了对比度,我忘记了这一点,我的显示器是空白的.你的西蒙 M.

Minor point, have you tried trimming the pot? I suspect that this sets the contrast, and I forgot this and I had a blank display. Yours Simon M.

这篇关于使文本显示在 I2C LCD 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆