本文整理汇总了C++中LiquidCrystal_I2C::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ LiquidCrystal_I2C::clear方法的具体用法?C++ LiquidCrystal_I2C::clear怎么用?C++ LiquidCrystal_I2C::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LiquidCrystal_I2C
的用法示例。
在下文中一共展示了LiquidCrystal_I2C::clear方法的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: 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
}
示例3: setPressure
void setPressure() {
lcd.clear();
lcd.print("Baromethric");
lcd.setCursor(0, 1);
lcd.print("10000");
lcd.print(" kPa");
}
示例4: 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);
}
}
示例5: setHumidity
void setHumidity() {
float newHumidity = dht.readHumidity();
lcd.clear();
lcd.print("Humidity");
lcd.setCursor(0, 1);
lcd.print(newHumidity);
lcd.print(" %");
}
示例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: 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] );
}
示例8: loop
void loop() {
int value = analogRead(TEMP_PIN);
float celsius = ((value * 5.0) / 1024.0 - 0.5) * 100;
float fahrenheit = (celsius * 9.0 / 5.0) + 32.0;
String temperatureCelsius = String(celsius);
String temperatureFahrenheit = String(fahrenheit);
lcd.clear();
lcd.print(temperatureCelsius);
lcd.print(" degrees C");
lcd.setCursor(0, 1);
lcd.print(temperatureFahrenheit);
lcd.print(" degrees F");
delay(5000);
}
示例9: step1
int step1()
{
//Wait for GPS
lcd.clear();
lcd.println(F("Looking for GPS"));
lcd.setCursor(0, 1);
char str[32];
sprintf(str,"view:%2d fix:%2d", sats_view, sats_fix);
lcd.print(str);
delay(1000);
if(millis() > sleep_time + 300000) digitalWrite(ON_PIN, 0);
if(gps_fix == 3) return 1;
else return 0;
}
示例10: goSleep
void DisplayClass::goSleep()
{
lcd.clear();
lcd.home();
lcd.print(F("Low Power Mode"));
lcd.setCursor(0, 1);
lcd.print(F("Going to sleep in:"));
lcd.setCursor(0, 2);
lcd.print(F("3"));
DELAY_FUNC(333);
for (uint8_t i = 0; i < 3; i++)
{
lcd.print(F("."));
DELAY_FUNC(333);
}
lcd.print(F("2"));
DELAY_FUNC(333);
for (uint8_t i = 0; i < 3; i++)
{
lcd.print(F("."));
DELAY_FUNC(333);
}
lcd.print(F("1"));
DELAY_FUNC(333);
for (uint8_t i = 0; i < 3; i++)
{
lcd.print(F("."));
DELAY_FUNC(333);
}
lcd.print(F("0!"));
DELAY_FUNC(333);
for (uint8_t i = 0; i < 3; i++)
{
noBacklight();
DELAY_FUNC(500);
backlight();
DELAY_FUNC(500);
}
}
示例11: navigationCheckLocation
bool navigationCheckLocation()
{
while ( currentNavigationLocation < 0 )
{
lcd.clear();
lcd.print( "Where am I starting?" );
lcdSelectLocation();
while ( digitalRead(LCD_UP_PIN) == HIGH || digitalRead(LCD_DOWN_PIN) == HIGH || digitalRead(LCD_PLAY_PIN) == HIGH )
{
if ( digitalRead(LCD_UP_PIN) == LOW )
{
navigationSounds->play( soundUp );
if ( --lcdCurrentSelection < 0 ) lcdCurrentSelection = MAP_LOCATION_COUNT - 1;
delay(250); //debounce time
break;
}
if ( digitalRead(LCD_DOWN_PIN) == LOW )
{
navigationSounds->play( soundDown );
if ( ++lcdCurrentSelection == MAP_LOCATION_COUNT ) lcdCurrentSelection = 0;
delay(250); //debounce time
break;
}
if ( digitalRead(LCD_PLAY_PIN) == LOW )
{
navigationSounds->play( soundUhoh );
currentNavigationLocation = lcdCurrentSelection;
currentNavigationHome = lcdCurrentSelection;
/*
Serial.print( "Current Location: " );
Serial.print( currentNavigationLocation );
Serial.print( ": " );
Serial.println( destinationList[currentNavigationLocation] );
*/
delay(250); //debounce time
break;
}
}
return false;
}
return true;
}
示例12: updatelcd
void updatelcd()
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("XT");
lcd.setCursor(3,0);
lcd.print(_XEncoderTicks);
lcd.setCursor(10,0);
lcd.print("XI");
lcd.setCursor(13,0);
lcd.print(_XEncoderIndex);
lcd.setCursor(18,0);
lcd.print("X");
lcd.setCursor(19,0);
lcd.print(">" + _XMinPinSet);
lcd.setCursor(17,0);
lcd.print("<" + _XMaxPinSet);
lcd.setCursor(0,1);
lcd.print("YI");
lcd.setCursor(3,1);
lcd.print(_YEncoderTicks);
lcd.setCursor(10,1);
lcd.print("YI");
lcd.setCursor(13,1);
lcd.print(_YEncoderIndex);
lcd.setCursor(18,1);
lcd.print("Y");
lcd.setCursor(19,1);
lcd.print("V" + _YMinPinSet);
lcd.setCursor(17,1);
lcd.print("^" + _YMaxPinSet);
/*
lcd.setCursor(15,0);
lcd.print(_XCsens);*/
lcd.setCursor(3,3);
lcd.print("<" + _XJoyLeft);
lcd.setCursor(5,3);
lcd.print(">" + _XJoyRight);
lcd.setCursor(4,3);
lcd.print("^" + _YJoyUp);
lcd.setCursor(4,3);
lcd.print("V" + _YJoyDown);
delay(20);
}
示例13: connectOk
void connectOk()
{
debugf("connected");
WifiAccessPoint.enable(false);
lcd.clear();
lcd.print("\7 ");
lcd.print(WifiStation.getIP().toString());
// Restart main screen output
procTimer.restart();
displayTimer.stop();
startWebClock();
// At first run we will download web server content
if (!fileExist("index.html") || !fileExist("config.html") || !fileExist("api.html") || !fileExist("bootstrap.css.gz") || !fileExist("jquery.js.gz"))
downloadContentFiles();
else
startWebServer();
}
示例14: close_box
void close_box(){
lcd.clear();
lcd.print(F(" Locking box "));
Serial.println(F("Locking box"));
// servo.attach(SERVO_PIN);
digitalWrite(SERVO_ON_PIN, 1);
delay(5000);
servo.write(DOOR_CLOSED);
delay(1000);
// delay(5000);
//servo.detach();
digitalWrite(SERVO_ON_PIN, 0);
}
示例15: connectFail
void connectFail()
{
debugf("connection FAILED");
WifiAccessPoint.config("MeteoConfig", "", AUTH_OPEN);
WifiAccessPoint.enable(true);
// Stop main screen output
procTimer.stop();
displayTimer.stop();
lcd.clear();
lcd.setCursor(0,0);
lcd.print("WiFi MeteoConfig");
lcd.setCursor(0,1);
lcd.print(" ");
lcd.print(WifiAccessPoint.getIP());
startWebServer();
WifiStation.waitConnection(connectOk); // Wait connection
}