本文整理汇总了C++中LCD::setLineOne方法的典型用法代码示例。如果您正苦于以下问题:C++ LCD::setLineOne方法的具体用法?C++ LCD::setLineOne怎么用?C++ LCD::setLineOne使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LCD
的用法示例。
在下文中一共展示了LCD::setLineOne方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(void)
{
POWEROFF();
delayU(100);
POWERUP();
lcd.setLineOne("Welcome to");
lcd.setLineTwo("TowerBuilder");
sei(); //Enable global interrupt
while(1)
{
//Send 1 character to LCD if LCD is ready
if(lcd.ready())
lcd.print();
//Task scheduler
if(taskDone == FALSE) {
switch(taskNumber++) {
case 0:
button.readButtons();
menu();
break;
case 1:
adc.convertPOT();
break;
case 2:
sensor.readSensors();
break;
case 3:
first();
break;
case 4:
break;
case 5:
break;
case 6:
break;
default:
taskNumber = 0;
break;
}
taskDone = TRUE;
//Update servo's channel after each task finished
while(updateChannel == FALSE);
servo.servoPWM();
updateChannel = FALSE;
}
}
}
示例2: menu
void menu() {
//Add your code here
//You may add more functions or volatile variables
//But DO NOT modify anything else
//Press S1 to display the first group member's student id
//Press S1 again to display the second group member's student id
//Debouncing need to be done for S1 to work properly
//16 char for each row LCD
char row1[]= "F12 M67 B12 ";
char row2[]= " ";
char MidS= sensor.middle_sensor;
char MidL= MidS & 0xF0;
MidL= MidL>>4;
char MidR= MidS & 0x0F;
char FrontS= sensor.front_sensor;
char FrontL= FrontS & 0xF0;
FrontL= FrontL>>4;
char FrontR= FrontS & 0x0F;
char BackS= sensor.back_sensor;
char BackL= BackS & 0xF0;
BackL= BackL>>4;
char BackR= BackS & 0x0F;
//////////////////////////////////convert to ascii number
if ( MidL <10 )
{
MidL += 0x30;
}
else
{
MidL +=55;
}
if (MidR <10)
{
MidR += 0x30;
}
else
{
MidR +=55;
}
row1[6]= MidL;
row1[7]= MidR;
////////////////////////// c TO d, 3 TO b/f
if ( FrontL <10 )
{
FrontL += 0x30;
}
else
{
FrontL +=55;
}
if (FrontR <10)
{
FrontR += 0x30;
}
else
{
FrontR +=55;
}
row1[1]= FrontL;
row1[2]= FrontR;
//////////////////////////
if ( BackL <10 )
{
BackL += 0x30;
}
else
{
BackL +=55;
}
if (BackR <10)
{
BackR += 0x30;
}
else
{
BackR +=55;
}
row1[11]= BackL;
row1[12]= BackR;
lcd.setLineOne(row1);
row2[0] = condition + 48;
row2[2] = nextCondition + 48;
//.........这里部分代码省略.........