LiquidCrystal: One bugfix in setCursor and change all atributes from private to protected #37
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
It is my first contribution to Arduino I hope changes I have made are useful ones :)
In case when LiquidCrystal was initialized for 4 line display and using setCursor with line 4 would read some garbage from memory as row_offset
Second change is to allow override behavior of single functions for derived classes. For example - LCD 4x16 has different row_offsets than 4x20 so with all attributes being protected instead of private You can do something like that:
and then use NewLQ if You have 4x16 instead of copying whole LiquidCrystal into sketch and making changes to row offsets.
Row offsets I got from this thread http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1253367247
I'll try to patch LiquidCrystal to work out of the box both with 4x20 and 4x16, but this is simple fix useful in more scenarios.