本文整理汇总了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());
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例5: setPressure
void setPressure() {
lcd.clear();
lcd.print("Baromethric");
lcd.setCursor(0, 1);
lcd.print("10000");
lcd.print(" kPa");
}
示例6: setTemperature
void setTemperature() {
float newTemperature = dht.readTemperature(false);
lcd.clear();
lcd.print("Temperature");
lcd.setCursor(0, 1);
lcd.print(newTemperature);
lcd.print(" C");
}
示例7: printDigits
void printDigits(int digits, char separator)
{
if (separator != NULL)
lcd.print(separator);
if(digits < 10)
lcd.print('0');
lcd.print(digits);
}
示例8: setHumidity
void setHumidity() {
float newHumidity = dht.readHumidity();
lcd.clear();
lcd.print("Humidity");
lcd.setCursor(0, 1);
lcd.print(newHumidity);
lcd.print(" %");
}
示例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();
}
示例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;
}
示例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] );
}
示例12: setup
void setup() {
lcd.print("LOADING");
lcd.begin(20, 4);
sensorManager.init();
initButtons();
Serial.begin(9600);
setSyncProvider(RTC.get);
EEPROM_readAnything(0, altitude);
}
示例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();
}
}
示例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();
}
示例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 ----------------
}