This Arduino sketch enables scrolling text display on Liquid Crystal Display (LCD). Rows and columns can be customised further It provides functionalities to display text in a scrolling manner, ensuring that longer messages are adequately presented within the limited screen space.
- Text Display: Displays text messages on an LCD screen.
- Scrolling Styles:
- Text Shift on Limit: Shifts the entire text horizontally to ensure that all characters are displayed within the specified LCD dimensions. If the text exceeds the width of the LCD, it scrolls horizontally to reveal the hidden characters.
- Scrolling Up Style: Scrolls the text vertically, moving it upward to reveal hidden lines of text. It scrolls line by line until all lines have been displayed.
- Dynamic Length Handling: Automatically adjusts for varying message lengths.
- Customizable Rows and Columns: Easily configure the number of rows and columns on your LCD display.
- Hardware: Arduino board, Liquid Crystal Display (LCD), and required connections.
- Software: Arduino IDE (Integrated Development Environment).
- Connect the LCD to the Arduino board according to the specified pin configuration.
- Open the Arduino IDE.
- Copy the provided code into a new Arduino sketch.
- Customize the numRows and numCols variables in the code to match your LCD dimensions.
- Upload the sketch to your Arduino board.
- Connect the Arduino board to a power source.
- Open the serial monitor in the Arduino IDE.
- Enter text messages to be displayed on the LCD screen. Each message should be terminated by pressing the Enter key.
- Choose the desired scrolling style by commenting out or removing the function call for one style and uncommenting or adding the function call for the other style in the loop function of the code.
- The sketch will automatically process the messages and display them on the LCD screen using the selected scrolling style.
-
Rows and Columns: Adjust the
numRows
andnumCols
constants in the code to match your LCD dimensions.const uint8_t numRows = 2; // Change this value to match the number of rows on your LCD const uint8_t numCols = 16; // Change this value to match the number of columns on your LCD
-
You can comment the scrolling style you don't want to use or just copy the part of code you want to use.
- Ensure that the connections between the Arduino board and the LCD are correctly established.
- Check the serial monitor for debugging messages or to observe the processing of input text.
- If extremely larger text is needed to print, consider adjusting the data types of variables such as len, numSubStr, and others to accommodate larger values. Using long long, double, or size_t might be more suitable in such cases.
- Pyae Sone Hein - GitHub
This project is licensed under the MIT License - see the LICENSE file for details.