-
-
Notifications
You must be signed in to change notification settings - Fork 7k
LiquidCrystal improvements (support 16x4 displays) #1748
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
Conversation
Original commit by Mark Sproul, but cleaned up by Matthijs Kooijman.
Since these are memory addresses, there is no need to make them signed. Furthermore, the HD44780 chip supports memory addresses up to 0x67, so uint8_t shouldbe sufficient.
…s well Before, the row value was maximized against _numlines already, but the value from _numlines is not limited anywhere, so it could be longer than the length of _row_offsets. This check makes sure the array bounds is never exceeded.
Previously, the row offsets were hardcoded to the ones used for 20x4 displays (which woudl also work for all 2-line displays). Now, the number of columns given is used to calculate the offsets most likely to apply. For 2-line displays and 20x4 displays, the (used) offsets are completel unchanged. With this change, common 16x4 displays and (if they even exist) other 4-line and 3-line displays might also work (depending on the hardware configuration used, of course). See this page for some info on common LCD sizes and configurations encountered in practice: http://web.alfredstate.edu/weimandn/lcd/lcd_addressing/lcd_addressing_index.html
Can I build this pull request? |
Hooray! |
@edthedev sorry for the comment from arduinobot. we are setting up automated build of all PRs, so that we can provide a downloadable version of the patched IDE |
Cool. No harm done. :)
|
Added functions to read data from LCD, to delete last character, to delete a character at specified position, get current position, get character from a position and get more characters at once, making it faster.
@ArduinoBot build this please |
Merged build finished. Test PASSed. |
@cmaglie works for me on linux64 |
\o/ |
This pullrequest was inspired by #55 and starts out with a cleaned up version of the main commit from that pullreq.
This allows setting custom row offsets for LCDs to support different LCD hardware configurations. Additionally, this changes the default row offsets (based on the number of columns set), so now 16x4 (and possibly others) are also supported out of the box.