『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 1657|回复: 4

[求助] 请问大家有试过ESPHOME ST7920的LCD12864吗?

[复制链接]

30

主题

137

帖子

1161

积分

金牌会员

Rank: 6Rank: 6

积分
1161
金钱
1024
HASS币
0
发表于 2021-9-21 10:52:50 | 显示全部楼层 |阅读模式
请问大家有无过ST7920的LCD12864吗?新更新的ESPHOME可以支持该模块。我自己用了一下,发现显示时间时,秒不能刷新,只能刷新分。不能显示中文。
如果大家有玩过的话,可以分享一下经验


回复

使用道具 举报

76

主题

1357

帖子

1万

积分

元老级技术达人

积分
18336
金钱
16939
HASS币
290
发表于 2021-9-21 12:54:16 | 显示全部楼层
本帖最后由 dscao 于 2021-9-21 12:57 编辑
Configuration variables:
cs_pin (Required, Pin Schema): Sometimes also called RS. For ST7920 should be inverted.

width (Required, int): The “width” of a screen. Defaults to 128.

height (Required, int): The “height” of a screen. Defaults to 64;

rotation (Optional): Set the rotation of the display. Everything you draw in lambda: will be rotated by this option. One of 0° (default), 90°, 180°, 270°.

lambda (Optional, lambda): The lambda to use for rendering the content on the display. See Display Rendering Engine for more information.

update_interval (Optional, Time): The interval to re-draw the screen. Defaults to 60s.

pages (Optional, list): Show pages instead of a single lambda. See Display Pages.

id (Optional, ID): Manually specify the ID used for code generation.
To use fonts you first have to define a font object in your ESPHome configuration file. Just grab a .ttf file from somewhere on the internet and place it, for example, inside a fonts folder next to your configuration file.

Next, create a font: section in your configuration:

font:
  - file: "fonts/Comic Sans MS.ttf"
    id: my_font
    size: 20

display:
  # ...
ssd1306默认是:
  • update_interval (Optional, Time): The interval to re-draw the screen. Defaults to 5s.

这个默认60s
update_interval: 1s  这些设置成不起作用吗?没用过这款,只用过ssd1306,而且也没使用秒显示。不看文档也没注意这些。
回复

使用道具 举报

30

主题

137

帖子

1161

积分

金牌会员

Rank: 6Rank: 6

积分
1161
金钱
1024
HASS币
0
 楼主| 发表于 2021-9-21 12:56:09 | 显示全部楼层
谢谢大腾,刚刚没想到这个问题,把这个添加进去后可以了。现在中文显示也解决了,感谢
回复

使用道具 举报

76

主题

1357

帖子

1万

积分

元老级技术达人

积分
18336
金钱
16939
HASS币
290
发表于 2021-9-21 13:09:39 | 显示全部楼层
看图片,这个引脚很多,屏幕面积也大不少,应该比ssd1306看着舒服一些吧。硬件上与esp32或8266接线方面会比较复杂吗?有没有接线方面的教程看看?
回复

使用道具 举报

30

主题

137

帖子

1161

积分

金牌会员

Rank: 6Rank: 6

积分
1161
金钱
1024
HASS币
0
 楼主| 发表于 2021-9-22 07:53:35 | 显示全部楼层
dscao 发表于 2021-9-21 13:09
看图片,这个引脚很多,屏幕面积也大不少,应该比ssd1306看着舒服一些吧。硬件上与esp32或8266接线方面会比 ...

这个就是SPI的接法,不是全部LCD12864都能够接SPI的,只有ST7920的才可以。ST7920的本来带字库,但在ESPHOME里不知道怎么调用ST7920的内部字库
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-4-27 01:34 , Processed in 0.064258 second(s), 26 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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