Advertisement
mudhita_triari

Access Point

Apr 21st, 2024
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | Source Code | 0 0
  1. #include <WiFi.h>
  2. #include <ESPAsyncWebServer.h>
  3.  
  4. const char* ssid = "AP_punye_dani";
  5. const char* password = "test";
  6. AsyncWebServer server(80);
  7.  
  8. void setup() {
  9.   Serial.begin(115200);
  10.  
  11.   WiFi.mode(WIFI_AP);
  12.   WiFi.softAP(ssid, password);
  13.  
  14.   Serial.println();
  15.   Serial.print("Access Point Berjalan, SSID: ");
  16.   Serial.println(ssid);
  17.  
  18.   IPAddress IP = WiFi.softAPIP();
  19.   Serial.print("IP Address: ");
  20.   Serial.println(IP);
  21.  
  22.   server.on("/", HTTP_GET, [](AsyncWebServerRequest *request) {
  23.     request->send(200, "text/html", "<h1>Selamat datang di Indobot Academy Access Point!</h1>");
  24.   });
  25.  
  26.   server.begin();
  27. }
  28.  
  29. void loop() {
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement