首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Arduino滚动sparkfun 2x16液晶屏

Arduino滚动sparkfun 2x16液晶屏
EN

Stack Overflow用户
提问于 2012-08-08 09:21:17
回答 1查看 3.6K关注 0票数 0

当我想要显示大于32个字符的内容时。我想要的液晶滚动,我已经尝试命令标志0x10能有人给我指出正确的方向。

EN

回答 1

Stack Overflow用户

发布于 2012-11-28 20:01:19

您尚未指明是要水平滚动还是要垂直滚动。

lcd库中自带水平滚动功能。使用自动滚动或scrollDisplayLeft/Right

代码语言:javascript
复制
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows: 
  lcd.begin(16,2);
 }

void loop() {

// set the cursor to (16,1):
lcd.setCursor(16,1);
// set the display to automatically scroll:
lcd.autoscroll();
// print from 0 to 9:
for (int thisChar = 0; thisChar < 10; thisChar++) {
 lcd.print(thisChar);
 delay(500);
}
// turn off automatic scrolling
lcd.noAutoscroll();

// clear screen for the next loop:
lcd.clear();
}

对于垂直滚动,您需要手动创建一个操作,将文本从第2行复制到第1行,并用新文本填充第2行。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11856409

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档