Center Text on Arduino LCD
I had a problem recently that I was trying to find a function or some code in order to center text on any of those LCD’s you can buy to use with your Arduino.
I found one post – and that was only marginally helpful.
So – TL;DR – here you go:
Replace ’20’ with the character length of your LCD – most are 16 or 20.
wherePrint = (20 - (strlen(yourstring)) / 2; lcd.setCursor(wherePrint, 1); lcd.print(yourstring);
I hope this helps you guys!
-
Recent
- Can’t program those new ATMEGA328 chips for your Arduino?
- Center Text on Arduino LCD
- Harbor Freight Drill Presses are Junk
- Q-Bond – not what is seems
- PurpleAir PHP Widget Download
- Android phones offering Root in 2017
- Think twice about YourMechanic
- IPB Forum Error Fix
- Javascript not working with Webbrowser control in VB.NET? Fixed.
- Tips on loading Safariland COMP Speedloaders
- The Walking Dead Rick’s Holster & Belt Gear
- Recipe Book: Three more Bachelor “Very Easy & Cheap eats”
-
Links
-
Archives
- August 2021 (1)
- May 2021 (1)
- April 2018 (1)
- March 2018 (1)
- December 2017 (1)
- August 2017 (1)
- May 2017 (1)
- March 2015 (1)
- February 2015 (1)
- November 2014 (1)
- August 2014 (2)
- April 2014 (2)
-
Categories
-
RSS
Entries RSS
Comments RSS