本文整理汇总了C++中LiquidCrystal::setCursor方法的典型用法代码示例。如果您正苦于以下问题:C++ LiquidCrystal::setCursor方法的具体用法?C++ LiquidCrystal::setCursor怎么用?C++ LiquidCrystal::setCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LiquidCrystal
的用法示例。
在下文中一共展示了LiquidCrystal::setCursor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printDateAndTime
void printDateAndTime(LiquidCrystal & lcd, Date & date, Time & time) {
lcd.clear();
lcd.setCursor(0,0);
date.print(lcd);
lcd.setCursor(0,1);
time.print(lcd);
}
示例2: getTempPoint
// Allows user to change and select the temperature point
// index: index of the current temperature point
int CurveInput::getTempPoint( int index )
{
initLCD(&col, &row);
lcd.print("Enter Temp ");
lcd.print(index);
lcd.print(" (C)");
lcd.setCursor(0, 1);
byte buttonID = NONE;
int lowerLimit, upperLimit;
temps[index] = getTempLimits(index, &lowerLimit, &upperLimit);
int thisTemp = temps[index]; // scoping
lcd.print(thisTemp);
col = 0; row = 1;
lcd.setCursor(col, row);
delay(SELECT_DURATION);
while ( buttonID != SELECT ) // any button other than SELECT
{
buttonID = btn.waitForButton();
thisTemp = btn.actionIncDec(buttonID, TIME_TEMP_DURATION,
col, row, thisTemp, 3,
lowerLimit, upperLimit);
// user adjusts temperature
}
return thisTemp;
}
示例3: loop
void loop() {
lcd.clear();
lcd.print("http://powerpacks." );
lcd.setCursor( 0,1 );
lcd.print("ArcolaEnergy.com");
lcd.setCursor( 0,3 );
lcd.print(RTC.get(DS1307_HR,true)); //read the hour and also update all the values by pushing in true
lcd.print(":");
lcd.print(RTC.get(DS1307_MIN,false));//read minutes without update (false)
lcd.print(":");
lcd.print(RTC.get(DS1307_SEC,false));//read seconds
lcd.print(" "); // some space for a more happy life
lcd.print(RTC.get(DS1307_DATE,false));//read date
lcd.print("/");
lcd.print(RTC.get(DS1307_MTH,false));//read month
lcd.print("/");
lcd.print(RTC.get(DS1307_YR,false)); //read year
digitalWrite( STATUS_OK, HIGH);
digitalWrite( STATUS_BAD, LOW );
delay( 100 );
digitalWrite( STATUS_OK, LOW);
digitalWrite( STATUS_BAD, HIGH );
delay( 100 );
}
示例4: loop
void loop() {
statoPulsante = digitalRead(6);
if(statoPulsante != precedenteStatoPulsante)
if (statoPulsante == LOW) {
risposta = random(8);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("La Palla dice:");
lcd.setCursor(0,1);
switch(risposta) {
case 0: lcd.print("Si"); break;
case 1: lcd.print("Molto probabilmente"); break;
case 2: lcd.print("Certamemte"); break;
case 3: lcd.print("Sembra di si"); break;
case 4: lcd.print("Insicuro"); break;
case 5: lcd.print("Domanda ancora"); break;
case 6: lcd.print("Molto dubbio"); break;
case 7: lcd.print("NO"); break;
};
};
precedenteStatoPulsante = statoPulsante;
}
示例5: loop
void loop() {
noLight=digitalRead(digitalSignal);//
lightness=analogRead(analogSignal); // и о его количестве
// set the cursor to column 0, line 1
lcd.setCursor(0, 0);
//вывод сообщения
Serial.print("There is ");
lcd.clear();
if (noLight) {
Serial.println("1");
lcd.print("1");
}
else {
Serial.println("0");
lcd.print("0");
}
Serial.print("value: ");
Serial.println(lightness);
lcd.setCursor(0, 1);
//clearLCD();
lcd.print(lightness);
delay(1000); //задержка 1 сек
}
示例6: getTimePoint
// Allows user to change and select the time point
// index: index of the current time point
int CurveInput::getTimePoint( int index )
{
initLCD(&col, &row);
lcd.print("Enter Time ");
lcd.print(index);
lcd.print(" (s)");
lcd.setCursor(0, 1);
byte buttonID = NONE;
int thisTime = times[index]; // scoping current time
lcd.print(thisTime);
col = 0; row = 1;
lcd.setCursor(col, row);
delay(SELECT_DURATION);
int lowerLimit, upperLimit;
getTimeLimits(index, &lowerLimit, &upperLimit);
while ( buttonID != SELECT ) // any button other than SELECT
{
buttonID = btn.waitForButton();
thisTime = btn.actionIncDec(buttonID, TIME_TEMP_DURATION,
col, row, thisTime, 3,
lowerLimit, upperLimit);
// user adjusts time
}
return thisTime;
}
示例7: loop
void loop(){
if(analogRead(0)<800)err=0;
while(err!=1 && digitalRead(pinErr)!=HIGH){
digitalWrite(pinR1, LOW);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("R1 ON");
delay(5000);
digitalWrite(pinR2, LOW);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("R2 ON");
delay(5000);
//if(analogRead(pinTemp)<=0 && analogRead(pinTemp)>=100) digitalWrite(pinR3, LOW);
//else err=1;
if(digitalRead(pinErr)==HIGH) {
err=1;
lcd.clear();
lcd.print("Err R3");
digitalWrite(pinR1, HIGH);
digitalWrite(pinR2, HIGH);
digitalWrite(pinR3, HIGH);
}
}
lcd.setCursor(0,0);
lcd.print("Error!");
digitalWrite(pinR1, HIGH);
digitalWrite(pinR2, HIGH);
digitalWrite(pinR3, HIGH);
}
示例8: getTimePoint
// Allows user to change and select the time point
// index: index of the current time point
int CurveInput::getTimePoint( int index )
{
initLCD(&col, &row);
lcd.print("Duration ");
lcd.print(index);
lcd.print(" (s)");
lcd.setCursor(0, 1);
byte buttonID = NONE;
int lowerLimit = 1;
int upperLimit = 150;
//times[index] = getTimeLimits(index, &lowerLimit, &upperLimit);
int duration;
if ( index == 1 ) duration = 125;
else if ( index == 2 ) duration = 90;
else if ( index == 3 ) duration = 90;
else duration = 30;
lcd.print(duration);
col = 0; row = 1;
lcd.setCursor(col, row);
delay(SELECT_DURATION);
while ( buttonID != SELECT ) // any button other than SELECT
{
buttonID = btn.waitForButton();
duration = btn.actionIncDec(buttonID, TIME_TEMP_DURATION,
col, row, duration, 3,
lowerLimit, upperLimit);
// user adjusts time
}
return times[index-1] + duration;
}
示例9: refrashScreen
void LcdHandler::refrashScreen(int menuPosittion, double *setParameters, Menu *menu)
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(menu->getItem(menuPosittion));
lcd.setCursor(0, 1);
lcd.print((int)setParameters[menuPosittion]);
}
示例10: printCurveChoices
// Prints curve choices on the LCD screen
void CurveInput::printCurveChoices()
{
initLCD(&col, &row);
lcd.print("A: Default Curve");
lcd.setCursor(0, 1);
lcd.print("B: User Curve");
lcd.setCursor(0, 0);
}
示例11: loop
void loop()
{
// reads the value of the analog sensor
int sensorVal = analogRead(sensorPin);
Serial.print("Sensor Value: ");
Serial.print(sensorVal);
// converts the measure from the ADC (analog to digital converter) to volts
float voltage = (sensorVal/1024.0)*5.0;
Serial.print(", Volts: ");
Serial.print(voltage);
// turn volts into temperature in Celsius (C)
float temperature = (voltage - 0.5)*100;
Serial.print(", degrees C: ");
Serial.println(temperature);
if(temperature < baselineTemp)
{
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}
else if(temperature >= baselineTemp+2 && temperature < baselineTemp+4)
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}
else if(temperature >= baselineTemp+4 && temperature < baselineTemp+6)
{
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
}
else if(temperature >= baselineTemp+6)
{
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
}
delay(750);
// enumeration of th positions in the LCD start at 0
lcd.setCursor(0, 0); // set the cursor of the LCD in the first position of the first row
lcd.print(temperature); // print the value of the variable temperature in Celsius (C)
lcd.print(" C");
lcd.setCursor(0, 1); // set the cursor of the LCD in the first position of the second row
lcd.print(1.8*temperature + 32); // print the value of the variable temperature in Farenheit (F)
lcd.print(" F");
}
示例12: loop
void loop()
{
lcd.setCursor(3,1);
lcd.write(1); // desenha o coração
delay(500);
lcd.setCursor(3,1);
lcd.print(" Hello World! "); // Após 0.5s apaga o coração, assim ele
delay(500); // ficará piscando
}
示例13: loop
void loop() {
lcd.setCursor(0, 1);
lcd.print(rotors[2]);
lcd.setCursor(8, 1);
lcd.print(rotors[1]);
lcd.setCursor(15, 1);
lcd.print(rotors[0]);
delay(100);
}
示例14: printDateTime
void Clock::printDateTime(void) {
lcd.clear();
lcd.setCursor(0, 0);
printDate();
// Start at beginning of second line
lcd.setCursor(0, 1);
printTime();
}
示例15: lcd_printMoisture
void lcd_printMoisture(Moisture *moisture) {
lcd.setCursor(4, 0);
char pch[4];
sprintf(pch, "%02d", moisture->proc);
lcd.print(pch);
lcd.setCursor(13, 0);
sprintf(pch, "%02d", moisture->maxProc);
lcd.print(pch);
}