Created
January 11, 2019 02:42
-
-
Save clive520/b88324e5093e514623a5abeacd241081 to your computer and use it in GitHub Desktop.
ESP8266_連上wifi_顯示IP於LCD_NodeMCU_ESP8266
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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