2017-10-20 79 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 

這應該可以解決溢流到頂部線。