HD44780: Can't understand how `CreateCharacter` works

未关闭
#618 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
44/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
go
领域
embedded-iot

调研方向

Start by reading the HD44780 driver’s CreateCharacter, Write, and Display entry points to understand how custom character slots are addressed. Reproduce the reported behavior with the two examples that define and display the same character at slots 0x0 and 0x1; done means both slots display the defined character correctly, or the issue explains the expected slot usage. The issue names no test or file path.

由索引模型根据 Issue 内容生成。

描述

Hello there,

Thanks for this awesome library, I have a project for using an HD44780 LCD display with my pico and it fits perfectly.

For the need of my project, I need to display 4 custom characters to the first 2x2 LCD matrix

So (0,0), (1,0), (0,1) and (1,1).

I've defined my custom characters to be like this

lcd.CreateCharacter(0x0, []byte{0x00, 0x07, 0x07, 0x18, 0x18, 0x18, 0x18, 0x19})
lcd.CreateCharacter(0x1, []byte{0x00, 0x1C, 0x1C, 0x03, 0x03, 0x0F, 0x0F, 0x13})
lcd.CreateCharacter(0x2, []byte{0x19, 0x1E, 0x1E, 0x18, 0x18, 0x07, 0x07, 0x00})
lcd.CreateCharacter(0x3, []byte{0x13, 0x03, 0x03, 0x03, 0x03, 0x1C, 0x1C, 0x00})

and I print them doing

lcd.SetCursor(0, 0)
lcd.Write([]byte{0x0})
lcd.Display()

lcd.SetCursor(1, 0)
lcd.Write([]byte{0x1})
lcd.Display()

lcd.SetCursor(0, 1)
lcd.Write([]byte{0x2})
lcd.Display()

lcd.SetCursor(1, 1)
lcd.Write([]byte{0x3})
lcd.Display()

And when I run it, it show some weird stuff, like all the "custom" chars are merged or something.

I can't figure how it is possible, it seems like when I try to add offset to custom chars the result changes...

I think I might does not understand how it works.

Note that If i do

lcd.CreateCharacter(0x0, []byte{0x00, 0x07, 0x07, 0x18, 0x18, 0x18, 0x18, 0x19})
lcd.Write([]byte{0x0})
lcd.Display()

it works fine.

But using this (so the exact same character but in 0x1 memory place)

lcd.CreateCharacter(0x1, []byte{0x00, 0x07, 0x07, 0x18, 0x18, 0x18, 0x18, 0x19})
lcd.Write([]byte{0x1})
lcd.Display()

then the character is broken...

If anyone could explain to me how it's meant to be used it will be very nice 🙏

主要语言
Go
星标
756
派生
251
平均合并
7 天 12 小时
30 天内合并 PR
8

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tinygo-org/drivers 的其他 Issue

查看 tinygo-org/drivers 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。