Difference between revisions of "WeMOS: WiFi Connect"

From OnnoWiki
Jump to navigation Jump to search
(Created page with "#include <ESP8266WiFi.h> void setup() { Serial.begin(115200); //Baudrate Serial.println("WeMOS 2866 starts"); WiFi.begin("Kampus ITTS","itts2021"); Serial.print("Conn...")
 
 
Line 1: Line 1:
−
#include <ESP8266WiFi.h>
+
#include <ESP8266WiFi.h>  
  
−
void setup() {
+
void setup() {
−
  Serial.begin(115200); //Baudrate
+
  Serial.begin(115200); //Baudrate
−
  Serial.println("WeMOS 2866 starts");
+
  Serial.println("WeMOS 2866 starts");
−
  WiFi.begin("Kampus ITTS","itts2021");
+
  WiFi.begin("Kampus ITTS","itts2021");
−
  Serial.print("Connecting...");
+
  Serial.print("Connecting...");
−
  while(WiFi.status()!=WL_CONNECTED){ //Loop which makes a point every 500ms until the connection process has finished
+
  while(WiFi.status()!=WL_CONNECTED){ //Loop which makes a point every 500ms until the connection process has finished
−
    delay(500);
+
    delay(500);
−
    Serial.print(".");
+
    Serial.print(".");
−
  }
+
  }
−
  Serial.println();
+
  Serial.println();
−
  Serial.print("Connected! IP-Address: ");
+
  Serial.print("Connected! IP-Address: ");
−
  Serial.println(WiFi.localIP()); //Displaying the IP Address
+
  Serial.println(WiFi.localIP()); //Displaying the IP Address
−
}
+
}
−
 
+
−
void loop() {
+
void loop() {
−
  // put your main code here, to run repeatedly:
+
  // put your main code here, to run repeatedly:
−
}
+
}
  
  

Latest revision as of 11:16, 31 May 2022

#include <ESP8266WiFi.h> 
void setup() {
  Serial.begin(115200); //Baudrate
  Serial.println("WeMOS 2866 starts");
  WiFi.begin("Kampus ITTS","itts2021");
  Serial.print("Connecting...");
  while(WiFi.status()!=WL_CONNECTED){ //Loop which makes a point every 500ms until the connection process has finished
    delay(500);
    Serial.print(".");
  }
  Serial.println();
  Serial.print("Connected! IP-Address: ");
  Serial.println(WiFi.localIP()); //Displaying the IP Address
}

void loop() {
  // put your main code here, to run repeatedly:
}


Referensi