micropython-i2c-lcd icon indicating copy to clipboard operation
micropython-i2c-lcd copied to clipboard

Extended print with newline and center char

Open bstin opened this issue 1 year ago • 0 comments

The print function will now recognize newline and center chars and modify string accordingly.

The newline and center chars are configurable but set as "\n" and "\c" by default.

For example:

lcd.print("Line1\nLine2") will print (assuming 16 cols):

"Line1           "
"Line2           "

lcd.print("\cLine1\n\cLine2") will print (assuming 16 cols):

"     Line1      "
"     Line2      "

They can be mixed and matched, so this also works.

lcd.print("\cLine1\nLine2") will print (assuming 16 cols):

"     Line1      "
"Line2            "

bstin avatar Sep 23 '24 15:09 bstin