Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clive520/b88324e5093e514623a5abeacd241081 to your computer and use it in GitHub Desktop.
Save clive520/b88324e5093e514623a5abeacd241081 to your computer and use it in GitHub Desktop.
ESP8266_連上wifi_顯示IP於LCD_NodeMCU_ESP8266
/* Sketch was generated by motoblockly
Website: http://www.motoblockly.com
Author: www.motoduino.com
Date: Fri Jan 11 2019 08:34:04 GMT+0800
*/
//LCD接線方式{GND ==> GND VCC==>5V SDA==>D2(04) SCL==>D1(05)}
#include <Wire.h>
#include <esp_LiquidCrystal_I2C.h>
#include <ESP8266WiFi.h>
esp_LiquidCrystal_I2C mylcd(0x27, 16, 2);
void setup()
{
mylcd.init();
mylcd.backlight();
WiFi.begin("Motoduino","12345678");
while(WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
mylcd.setCursor(0,0);
mylcd.print(String("IP = ") + String(WiFi.localIP()));
delay(5000);
}
void loop()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment