Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Characters #55

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ColinTimBarndt
Copy link
Contributor

@ColinTimBarndt ColinTimBarndt commented Sep 17, 2024

This pull request allows defining custom characters. Closes #8.

This branch is currently based on #54 just for convenience, but I can rebase it onto the current version as it doesn't touch anything changed in that PR.

photo_2024-09-17_06-44-15
The custom character here is the diamond shape.

The current implementation has the drawback that it will reset the cursor position. This is required to change the writing mode from CHRAM back to DDRAM and we are currently not keeping track of the cursor position.

  • It would be nice to have a second opinion on this. Should we keep track of the cursor or just accept resetting the position?
  • Requires: Reading from the LCD #58

@ColinTimBarndt ColinTimBarndt changed the title Feature/custom characters Custom Characters Sep 17, 2024
@JohnDoneth
Copy link
Owner

It would be nice to have a second opinion on this. Should we keep track of the cursor or just accept resetting the position?

Interesting. It might make sense to see how other implementations in other languages like C handle this in their libraries?

@ColinTimBarndt
Copy link
Contributor Author

ColinTimBarndt commented Sep 17, 2024

I actually haven't looked at other implementations until now. It appears that the status includes the current DDRAM address. I would combine this PR with adding status fetching in that case, which would eliminate two problems at once.

https://github.com/duinoWitchery/hd44780/blob/27fd9d3809a92e744eef60b13dfcf4096c91cbe8/hd44780.cpp#L734

Though, this would first require implementing reading from the bus, which should be a separate PR.

@ColinTimBarndt ColinTimBarndt reopened this Oct 3, 2024
@robamu
Copy link

robamu commented Oct 17, 2024

I have tried to use this with my LCD1602, and it did not work like expected. The code also looks differently to the one specified here: https://github.com/mjhouse/ag-lcd/blob/24389f4e69de5f7d332504d70b9fc64d3301b668/src/display.rs#L752 which worked for me.

@ColinTimBarndt
Copy link
Contributor Author

Can you please explain what happened that was not expected?

@robamu
Copy link

robamu commented Oct 17, 2024

It was just another character than expected I think. I'd need to add back the old code to reproduce it.. I'm just wondering about the differences between this implementation and the ag-lcd one. I have since solved the issue differently, when looking up things in the datasheet, I saw that ° is actually part of the available characters in the driver peripheral.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Characters
3 participants