本文整理汇总了C++中LiquidCrystal::scrollDisplayLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ LiquidCrystal::scrollDisplayLeft方法的具体用法?C++ LiquidCrystal::scrollDisplayLeft怎么用?C++ LiquidCrystal::scrollDisplayLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LiquidCrystal
的用法示例。
在下文中一共展示了LiquidCrystal::scrollDisplayLeft方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mealSelect
int mealSelect(void)
{
byte tempCounter = 0;
for (int i = 0; i < 16; i++)
{
if (option0[i] || option1[i] || option2[i])
{
tempCounter++;
}
}
if (!tempCounter)
{
lcd.clear();
lcd.print("No response...");
delay(1000);
return 100;
}
char currentSelect = 0;
lcd.clear();
lcd.print("Select a meal");
for (int positionCounter = 0; positionCounter < 5; positionCounter++)
{
lcd.scrollDisplayLeft();
lcd.scrollDisplayLeft();
lcd.scrollDisplayLeft();
delay(500);
}
while(1)
{
if (currentSelect < 0)
{
currentSelect = 0;
}
if (currentSelect > 2)
{
currentSelect = 2;
}
switch (currentSelect)
{
case 0:
{
lcd.print(option0);
break;
}
case 1:
{
lcd.print(option1);
break;
}
case 2:
{
lcd.print(option2);
break;
}
default:
break; //shouldnt get here
}
char response = buttonCtl();
delay(250);
switch (response)
{
case 0:
{
currentSelect--;
lcd.clear();
break;
}
case 1:
{
currentSelect++;
lcd.clear();
break;
}
case 2:
{
lcd.clear();
return currentSelect;
break;
}
default:
{
break; //shoudlnt get here
}
}
}
}
示例2: priceSelect
int priceSelect(void)
{
char currentSelect = 0;
lcd.clear();
lcd.print("Select a price range");
for (int positionCounter = 0; positionCounter < 7; positionCounter++)
{
lcd.scrollDisplayLeft();
lcd.scrollDisplayLeft();
lcd.scrollDisplayLeft();
delay(500);
}
while(1)
{
if (currentSelect < 0)
{
currentSelect = 0;
}
if (currentSelect > 3)
{
currentSelect = 3;
}
switch (currentSelect)
{
case 0:
{
lcd.print("~$1 - $5 ->");
break;
}
case 1:
{
lcd.print("~$5 - $10 <->");
break;
}
case 2:
{
lcd.print("~$10 - $15 <->");
break;
}
case 3:
{
lcd.print("~$15 +up <- ");
break;
}
default:
break; //shouldnt get here
}
char response = buttonCtl();
delay(250);
switch (response)
{
case 0:
{
currentSelect--;
lcd.clear();
break;
}
case 1:
{
currentSelect++;
lcd.clear();
break;
}
case 2:
{
lcd.clear();
return currentSelect;
break;
}
default:
{
break; //shoudlnt get here
}
}
}
}