Skip to content

Extended print with newline and center char - #5

Open
bstin wants to merge 1 commit into
brainelectronics:mainfrom
bstin:bstin-newline-center-patch-1
Open

Extended print with newline and center char#5
bstin wants to merge 1 commit into
brainelectronics:mainfrom
bstin:bstin-newline-center-patch-1

Conversation

@bstin

@bstin bstin commented Sep 23, 2024

Copy link
Copy Markdown

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            "

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.
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.

1 participant