Skip to content

Lcd oop extensions #87

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

Closed
wants to merge 3 commits into from
Closed

Lcd oop extensions #87

wants to merge 3 commits into from

Conversation

manfredjonsson
Copy link

This Version of the Liquid Crystal Library can be inherited from other classes.
A possible usage is outlined in http://github.com/manfredjonsson/LiquidCrystalAddons

Because of the many changes, each commit contains one step of the improvements.

Commit 1: Fixes

  • Remove unneeded variables.
  • Make setCursor work for 16x2 and 16x4 displays.
  • I consider LCD_ENTRYSHIFTINCREMENT etc to be a missnomer. Use ...ENABLE and
    ...DISABLE instead.
  • Different variable names were used in definition and declaration of begin().
    Use the name "row" instead of "line" in all places to have a consistent
    wording.
  • Remove the begin() call from init() because some transport may not be
    initialized in a global constructor (Some versions of the Wire (I2C)
    library don't work when their begin() method is called inside a constructor
    of a global object).

Commit 2: Minimal set of changes for inheritance

  • Move functions and variables from private to protected.
  • Add the virtual keyword to all functions which may need an override in an
    derived class.

Commit 3: Make it smaller

  • Use the "-1" trick from rw for the data lines too. This enables the use of
    one writebits() function instead of two. Pay attention to the fact that
    pinMode is still in writebits(), this slows down each write to the LCD but
    code is smaller compared to an additional initialization loop.
  • Use the 4 upper bits of a byte in writebits() instead of the 4 lower bits
    for 4 bit writes. Leads to an almost identical initialization for 4 and 8
    bit mode.
  • Use the same code in 4 and 8 bit mode to force display to 8 bit mode and use
    a loop instead of three distinct calls to writebits().

zacmanchester referenced this pull request in zacmanchester/Energia Jul 23, 2012
Fix autoupdate and download url
@ffissore ffissore added the New label Feb 27, 2014
@cmaglie cmaglie added feature request A request to make an enhancement (not a bug fix) Library: LiquidCrystal The LiquidCrystal Arduino library labels Apr 8, 2015
@agdl
Copy link
Member

agdl commented Jul 12, 2016

This issue was moved to arduino-libraries/LiquidCrystal#11

@agdl agdl closed this Jul 12, 2016
@agdl
Copy link
Member

agdl commented Jul 12, 2016

Sorry closed by mistake

@agdl agdl reopened this Jul 12, 2016
@facchinm
Copy link
Member

Patches moved to https://github.com/arduino-libraries/LiquidCrystal/tree/pr_87 (mostly for historical reference)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A request to make an enhancement (not a bug fix) Library: LiquidCrystal The LiquidCrystal Arduino library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants