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


C++ LiquidCrystal_I2C类代码示例

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


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

示例1: 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

示例2: 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

示例3: loop

// The loop function is called in an endless loop
void loop() {
	delay(SENSOR_CHANGE_TRIGGER_TIME);
	unsigned long unchangedTime = millis() - lastMotionDetected;
	if (unchangedTime < MAX_ON_TIME) {
		lcd.display();
		lcd.backlight();
		switch (sensor) {
		case TEMPERATURE_SENSOR_NUM:
			setTemperature();
			break;
		case HUMIDITY_SENSOR_NUM:
			setHumidity();
			break;
		case SOIL_SENSOR_NUM:
			setSoilHumidity();
			break;
		case PRESSURE_SENSOR_NUM:
			setPressure();
			break;
		}
	} else {
		lcd.noDisplay();
		lcd.noBacklight();
	}
	delay(500);
}
开发者ID:kjetilfjellheim,项目名称:arduino_experiments,代码行数:27,代码来源:Senser.cpp

示例4: 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

示例5: 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

示例6: setTemperature

void setTemperature() {
	float newTemperature = dht.readTemperature(false);
	lcd.clear();
	lcd.print("Temperature");
	lcd.setCursor(0, 1);
	lcd.print(newTemperature);
	lcd.print(" C");
}
开发者ID:kjetilfjellheim,项目名称:arduino_experiments,代码行数:8,代码来源:Senser.cpp

示例7: printDigits

void printDigits(int digits, char separator)
{
  if (separator != NULL)
    lcd.print(separator);
  if(digits < 10)
    lcd.print('0');
  lcd.print(digits);
}
开发者ID:nicolasaujoux,项目名称:AquaMonitor,代码行数:8,代码来源:aquaMonitor.cpp

示例8: setHumidity

void setHumidity() {
	float newHumidity = dht.readHumidity();
	lcd.clear();
	lcd.print("Humidity");
	lcd.setCursor(0, 1);
	lcd.print(newHumidity);
	lcd.print(" %");
}
开发者ID:kjetilfjellheim,项目名称:arduino_experiments,代码行数:8,代码来源:Senser.cpp

示例9: setup_display

void setup_display(void)
{
	// Switch on the backlight
	//pinMode ( BACKLIGHT_PIN, OUTPUT );
	//digitalWrite ( BACKLIGHT_PIN, HIGH );
	
	lcd.begin(16,2);               // initialize the lcd
	lcd.home();

}
开发者ID:capolan,项目名称:TS0_firmware,代码行数:10,代码来源:Display_tsensor.cpp

示例10:

LCD::LCD(Cooler *cooler, CheeseDHT *dhtUp, CheeseDHT *dhtDown, CheeseLog* logger) {
  this->cooler = cooler;
  this->logger = logger;
  this->dhtUp = dhtUp;
  this->dhtDown = dhtDown;
  Wire.begin(4, 5);
  currentLCD.init();
  currentLCD.backlight();
  counter = 0;
}
开发者ID:cheese-ua,项目名称:smarthome.arduino,代码行数:10,代码来源:LCD.cpp

示例11: navigationReturnHome

void navigationReturnHome()
{
  navigationSounds->play( soundUhoh );
  currentNavigationDestination = currentNavigationHome;
  lcd.clear();
  lcd.print( "Returning home!" );

  lcd.setCursor(0, 2); lcd.print( "Next stop:" );
  lcd.setCursor(0, 3); lcd.print( destinationList[currentNavigationHome] );
}
开发者ID:robotgeek,项目名称:geekbot,代码行数:10,代码来源:Navigation.cpp

示例12: setup

void setup() {
	lcd.print("LOADING");

	lcd.begin(20, 4);
	sensorManager.init();
	initButtons();
	Serial.begin(9600);
	setSyncProvider(RTC.get);

	EEPROM_readAnything(0, altitude);
}
开发者ID:Bravo555,项目名称:ArudinoWeatherStation,代码行数:11,代码来源:main.cpp

示例13: setPower

void setPower(int state){
	power = state;
	lcd.setCursor(0,1);
	if(state==1){
		lcd.print("   Power ON     ");	
		lcd.backlight();
	}else{
		lcd.print("   Power OFF    ");	
		lcd.noBacklight();
	}

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

示例14: setup

void setup() {
  Serial.begin(9600);
  pinMode(SOILSENSOR, INPUT);
  pinMode(PUMPPIN, OUTPUT);
  
  // initialize the LCD
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Initializing...");

  dht.begin();
}
开发者ID:darrenrector,项目名称:darrenrector.github.io,代码行数:13,代码来源:ArduinoAutoWatering.c

示例15: flashx3

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

//-------- Initialise display ----------------
}
开发者ID:RFQED,项目名称:TensionTester,代码行数:13,代码来源:ArduinoCode.c


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