当前位置: 首页>>代码示例>>C++>>正文


C++ LiquidCrystal_I2C::setCursor方法代码示例

本文整理汇总了C++中LiquidCrystal_I2C::setCursor方法的典型用法代码示例。如果您正苦于以下问题:C++ LiquidCrystal_I2C::setCursor方法的具体用法?C++ LiquidCrystal_I2C::setCursor怎么用?C++ LiquidCrystal_I2C::setCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LiquidCrystal_I2C的用法示例。


在下文中一共展示了LiquidCrystal_I2C::setCursor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: init

void init()
{
	Serial.begin(SERIAL_BAUD_RATE);
	Serial.systemDebugOutput(true); // Allow debug print to serial
	Serial.println("Sming. Let's do smart things!");
	Wire.pins(2, 0);
	lcd.begin(16, 2);
	lcd.backlight();

	lcd.clear();
	lcd.setCursor(0, 0);
	lcd.print("DATE: 00/00/0000");
	lcd.setCursor(0, 1);
	lcd.print("TIME: 00:00");

	// Station - WiFi client
	WifiStation.enable(true);
	WifiStation.config(WIFI_SSID, WIFI_PWD); // Put you SSID and Password here

	// set timezone hourly difference to UTC
	SystemClock.setTimeZone(7);

	

	// Run our method when station was connected to AP (or not connected)
	WifiStation.waitConnection(connectOk, 30, connectFail); // We recommend 20+ seconds at start
}
开发者ID:db4linq,项目名称:SystemClock_NTP,代码行数:27,代码来源:application.cpp

示例2: processButton

void WeatherStation::processButton()
{
    #define GOTOSLEEP_TIME 2 //s

    setCurrentDate();
    buttonPressHours = runHours;
    buttonPressMinute = currentMinute;

    if ( DISPLAY_STATE_INIT == displayMgt.state )
    {
        lcd.backlight();

        lcd.setCursor(0,0);
        lcd.print("Weather Station");  //16
        lcd.setCursor(0,1);
        lcd.print("*** DFRobot ***");  //16

        addAction(ACTION_SAMPLE_DATA);
    }

    addAction(ACTION_DISPLAY);


    overTime = SLEEP_OVERTIME;
    /**to avoid RTC interrupt when goto sleep **/
    if ( (59 == currentMinute) && ( (currentSecond + overTime + GOTOSLEEP_TIME) >= 60 ))
    {
        overTime += (GOTOSLEEP_TIME + 1);
    }


}
开发者ID:pookiemaker,项目名称:Reviews,代码行数:32,代码来源:WeatherStation.cpp

示例3: Update

void LCD::Update() {
  if ((++counter) % 2 != 0) {
    logger->Info("LCD update - data");

    currentLCD.setCursor(0, 0);
    String line1 = BriefTemp(dhtUp, "U") + BriefTemp(dhtDown, "D");
    currentLCD.print(line1);

    String line2 = "COOLER: " + String(cooler->IsWorking() ? "ON" : "OFF");
    while (line2.length() < 16)
      line2 += " ";
    currentLCD.setCursor(0, 1);
    currentLCD.print(line2);
  } else {
    logger->Info("LCD update - time");

    String line1 = CheeseTime::DayOfWeek();
    while (line1.length() < 16)
      line1 += " ";
    currentLCD.setCursor(0, 0);
    currentLCD.print(line1);

    String line2 = CheeseTime::Current();
    while (line2.length() < 16)
      line2 += " ";
    currentLCD.setCursor(0, 1);
    currentLCD.print(line2);
  }
}
开发者ID:cheese-ua,项目名称:smarthome.arduino,代码行数:29,代码来源:LCD.cpp

示例4: computeUserInput

time_t computeUserInput(uint8_t index, uint8_t number)
{
  static time_t time;
  uint8_t numberPosition = index;
  uint8_t nextPosition = index + 1;

  switch (index)
  {
    case 0:
      if (number > 2)
        number = 0;
      time = 0;
      time = hoursToTime_t(number * 10);
      break;
    case 1:
      nextPosition = 3;
      if (hour(time) >= 20 && number > 3)
        number = 0;
      time += hoursToTime_t(number);
      break;
    case 2:
      numberPosition = 3;
      nextPosition = 4;
      if (number > 5)
        number = 0;
      time += minutesToTime_t(number * 10);
      break;
    case 3:
      numberPosition = 4;
      nextPosition = 6;
      time += minutesToTime_t(number);
      break;
    case 4:
      numberPosition = 6;
      nextPosition = 7;
      if (number > 5)
        number = 0;
      time += number * 10;
      break;
    case 5:
      time += number;
      numberPosition = 7;
      nextPosition = 0;
      lcd.setCursor(10,3);
      lcd.print("OK : *");
      break;
    default:
      return time;
  }

  lcd.setCursor(numberPosition,1);
  lcd.print(number);
  lcd.setCursor(numberPosition,2);
  lcd.print(" ");
  lcd.setCursor(nextPosition,2);
  lcd.print("^");

  return time;
}
开发者ID:nicolasaujoux,项目名称:AquaMonitor,代码行数:59,代码来源:aquaMonitor.cpp

示例5: setup

void setup()/*----( SETUP: RUNS ONCE )----*/
{
  lcd.begin(20, 4);        // initialize the lcd for 20 chars 4 lines and turn on backlight
  
  // Open serial communications and wait for port to open:
  Serial.begin(9600);

  // --- button setup

  pinMode(RunBtn, INPUT);
  pinMode(ChangeScanBtn, INPUT);

  digitalWrite(RunBtn, HIGH);
  digitalWrite(ChangeScanBtn, HIGH);


  pinMode(clampPin, OUTPUT);      // sets the digital pin as OUTPUT to drive FET clamp)

  pinMode(5, OUTPUT);      // sets the digital pin as output
  pinMode(6, OUTPUT);      // sets the digital pin as output
  pinMode(7, OUTPUT);      // sets the digital pin as output
  pinMode(11, OUTPUT);     // pin11= PWM  output / frequency output //Will Turner - This could go to pin 5 from 11.  CHANGED TO 9 AS IT WOULDNT REACH OTHERS


  // ------- Quick 3 blinks of backlight  -------------
  for (int i = 0; i < 3; i++)
  {
    lcd.backlight();
    delay(20);
    lcd.noBacklight();
    delay(20);
  }
  lcd.backlight(); // finish with backlight on

  //-------- Initialise display ----------------
  // NOTE: Cursor Position: CHAR, LINE) start at 0
  lcd.setCursor(0, 0); //Start at character 0 on line 0
  lcd.print("Tension Tester v1.5 "); // sets up the screen for the wire number and layer number being recorded
  lcd.setCursor(0, 2);
  lcd.print("     Press Run      ");

  Setup_timer2();

  // disable interrupts to avoid timing distortion
  cbi (TIMSK0, TOIE0);             // disable Timer0 !!! delay() is now not available
  sbi (TIMSK2, TOIE2);             // enable Timer2 Interrupt

  dfreq = 1000.0;                  // initial output frequency = 1000.o Hz
  tword_m = pow(2, 32) * dfreq / refclk; // calulate DDS new tuning word

  // setup start and end frequencies of sweep

  // setup initial values for loop
  adcflag = false;

  analogval = 0;
  digitalWrite(clampPin, HIGH);    // sets the pin high to short out large signals before amp (using a FET as clamp)
  avgcnt = 0.0;
}
开发者ID:RFQED,项目名称:TensionTester,代码行数:59,代码来源:ArduinoCode.c

示例6: changeStopLedState

void changeStopLedState()
{
  lcd.setCursor(0,0);
  lcd.print("Stop light time :");
  lcd.setCursor(0,1);
  digitalClockDisplay(led.getStopTime());
  lcd.setCursor(0,2);
  lcd.print("^");
  lcd.setCursor(0,3);
  lcd.print("Back : #");
}
开发者ID:nicolasaujoux,项目名称:AquaMonitor,代码行数:11,代码来源:aquaMonitor.cpp

示例7: changeHourState

void changeHourState()
{
  lcd.setCursor(0,0);
  lcd.print("Type the time :");
  lcd.setCursor(0,1);
  digitalClockDisplay(now());
  lcd.setCursor(0,2);
  lcd.print("^");
  lcd.setCursor(0,3);
  lcd.print("Back : #");
}
开发者ID:nicolasaujoux,项目名称:AquaMonitor,代码行数:11,代码来源:aquaMonitor.cpp

示例8: changeFadeOutState

void changeFadeOutState()
{
  lcd.setCursor(0,0);
  lcd.print("Fade out light time :");
  lcd.setCursor(0,1);
  digitalClockDisplay(led.getFadeOutTime());
  lcd.setCursor(0,2);
  lcd.print("^");
  lcd.setCursor(0,3);
  lcd.print("Back : #");
}
开发者ID:nicolasaujoux,项目名称:AquaMonitor,代码行数:11,代码来源:aquaMonitor.cpp

示例9: init

void DisplayClass::init()
{
	lcd.begin(20, 4);               // initialize the lcd 
	lcd.home();                   // go home
	lcd.print(F("  WATER DISPENSER"));
	lcd.setCursor(0, 1);
	lcd.print(F("    Version: "VERSION""));
	lcd.setCursor(0, 2);
	lcd.print(F("   INITALIZING..."));
	lcd.setCursor(0, 3);
	lcd.print(F("  Tiago Conceicao"));
}
开发者ID:sn4k3,项目名称:WaterDispenser,代码行数:12,代码来源:Display.cpp

示例10: printWaitScreen

void printWaitScreen()
{
  lcd.setCursor(0,0);
  digitalClockDisplay(now());

  lcd.setCursor(0,1);
  lcd.print("Output : ");
  lcd.print(percent);
  lcd.print("%");

  lcd.setCursor(0,3);
  lcd.print("Menu : #");
}
开发者ID:nicolasaujoux,项目名称:AquaMonitor,代码行数:13,代码来源:aquaMonitor.cpp

示例11: loop

void loop() {
  int sensorValue = analogRead(SOILSENSOR);
  Serial.print(sensorValue); Serial.print(" - ");

  if(sensorValue <= DRYNESS) 
  {
   // if the soil is too dry start watering for 1.5 seconds then
   // wait for seconds before monitoring again
   Serial.println("Soil dry start watering");
   digitalWrite(PUMPPIN, HIGH);
   delay(WATERDELAY);
   digitalWrite(PUMPPIN, LOW);
   delay(WATERPOSTDELAY);
  }

  float h = dht.readHumidity();
  float f = dht.readTemperature(true);  // Fahrenheit

  if (isnan(h) || isnan(f)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }
 
    lcd.setCursor(0, 0);
    lcd.print("Temp: ");
    lcd.print(f, 1);  // print only one decimal digit due to limited space
    lcd.print("\337F");

      
    lcd.setCursor(0, 1);
    lcd.print("SoilMoisture:");
    lcd.print(sensorValue);

  
//    lcd.setCursor(0,1);
//    lcd.print("Humidity: "); 
//    lcd.print(h, 1);
//    lcd.print("%");

//    Serial.print("Temp: ");
//    Serial.print(f);
//
//    Serial.print("Humidity: ");
//    Serial.print(h);

    //Serial.print("Soil Moisture: ");
    //Serial.print(sensorValue);
    
  delay(5000);
}
开发者ID:darrenrector,项目名称:darrenrector.github.io,代码行数:50,代码来源:ArduinoAutoWatering.c

示例12: setPressure

void setPressure() {
	lcd.clear();
	lcd.print("Baromethric");
	lcd.setCursor(0, 1);
	lcd.print("10000");
	lcd.print(" kPa");
}
开发者ID:kjetilfjellheim,项目名称:arduino_experiments,代码行数:7,代码来源:Senser.cpp

示例13: echoSerial

void echoSerial(){
 byte index=0;
 char outa[20];
 char outb[20];
 outb[0]='\0';
 boolean foundData=false;
 while (Serial.available() > 0){
   foundData=true;
   if(index < 19){
     outa[index]=Serial.read();
     index++;
     outa[index]= '\0'; 
   }else{ 
     if(index < 39){
       outb[index-20]=Serial.read();
       index++;
       outb[index-20]= '\0';
     }
   }
 }
 if(foundData){
   lcd.clear();
   lcd.home();
   lcd.print(outa);
   lcd.setCursor ( 0, 1 );
   lcd.print(outb);
 }
}
开发者ID:edboel,项目名称:projects,代码行数:28,代码来源:temp_serial1.c

示例14: startWebServer

void startWebServer()
{
	server.listen(80);
	server.addPath("/", onIndex);
	server.addPath("/lcd", onLcd);
	server.addPath("/volume", onVolume);
	server.addPath("/mute", onMute);
	server.addPath("/source", onSource);
	server.addPath("/state", onState);
	server.addPath("/power", onPower);
	server.addPath("/tune", onTune);
	server.addPath("/mixing", onMixing);
	server.addPath("/enhance", onEnhance);
	
		// Web Sockets configuration
	server.enableWebSockets(true);
	server.setWebSocketConnectionHandler(wsConnected);
	server.setWebSocketMessageHandler(wsMessageReceived);
	server.setWebSocketBinaryHandler(wsBinaryReceived);
	server.setWebSocketDisconnectionHandler(wsDisconnected);

	
	server.setDefaultHandler(onFile);

	Serial.println("\r\n=== WEB SERVER STARTED ===");
	Serial.println(WifiStation.getIP());
    lcd.clear();
    lcd.setCursor(1,1);
	lcd.print(WifiStation.getIP());
}
开发者ID:avtehnik,项目名称:esp8266-music-box,代码行数:30,代码来源:application.cpp

示例15: setSource

void setSource(int sourc){

	source = sourc;
	int sourceID = 0;
    lcd.home();                   // go home
	lcd.setCursor(0,1);
	
	if( source == 0){
       sourceID = 0xC7;
       lcd.print("     5.1        ");
    }else if( source == 1){
       sourceID =  0xCB;
       lcd.print("    FM Radio    ");
    }else if( source == 2){
       sourceID =  0xCA;
  	   lcd.print("     AUX 2      ");
    }else if( source == 3){
       sourceID = 0xC9;
	   lcd.print("     AUX 3      ");
    }else if( source == 4){
       sourceID = 0xC8;
	   lcd.print("     AUX 4      ");
    }

	if(sourceID){
	    Wire.beginTransmission(PT2323_ADDRESS);
	  	Wire.write(DEVICE_REG_MODE1);
	  	Wire.write(sourceID);
	  	Wire.endTransmission();
	}


}
开发者ID:avtehnik,项目名称:esp8266-music-box,代码行数:33,代码来源:application.cpp


注:本文中的LiquidCrystal_I2C::setCursor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。