2017-10-20 38 views
0

以下代码从左向右滚动文字,但会将溢出字符包裹到第一行。如何让文本全部显示,从左到右滚动,但只在底部滚动。停止Arduino液晶文字两行包装

// 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 
    } 


} 
+0

除截断? –

+0

对不起,我不清楚。我基本上希望屏幕的行为像16x1一样,我希望文本从左到右滚动一行。 –

回答

0

根据this交上Arduino的形式,列的量设定为更高的量将溢出到顶部线停止显示。

这条线:

lcd.begin(16, 2);//LCD order 

变为:

lcd.begin(40, 2);//LCD order 

这应该可以解决溢流到顶部线。