以下代码从左向右滚动文本,但将溢出字符换行到顶行。如何让文本完整显示,从左到右滚动,但仅在底行。
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(9, 8, 5, 4, 3, 2);
void setup()//method used to run the code for once
{
lcd.begin(16, 2);//LCD order
lcd.setCursor(0,1);//Setting the cursor on LCD
lcd.print("www.TheEngineeringProjects.comwww.TheEngineeringProjects.com");//prints on LCD
delay(1000);//delay of 1 second
}
void loop() //used to run the code repeatedly
{
for(int PositionCount=0;PositionCount<20; PositionCount++)//loop for scrolling the LCD text
{
lcd.scrollDisplayLeft();//builtin command to scroll left the text
delay(150);// delay of 150 msec
}
}
根据这篇关于Arduino表单的文章,将列的数量设置为更高的数量将阻止显示溢出到顶行。
这一行:
lcd.begin(16, 2);//LCD order
成为:
lcd.begin(40, 2);//LCD order
这应该将溢出固定在顶线上。