Hirdetés
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- Melyik tápegységet vegyem?
- Milyen billentyűzetet vegyek?
- AMD Navi Radeon™ RX 9xxx sorozat
- Projektor topic
- AMD Navi Radeon™ RX 7xxx sorozat
- Hővezető paszták
- Milyen házat vegyek?
- 5.1, 7.1 és gamer fejhallgatók
- AMD Ryzen 9 / 7 / 5 / 3 5***(X) "Zen 3" (AM4)
-
PROHARDVER!
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
#include <ESP8266WiFi.h>
WiFiServer server(80); //a szerver a 80-as portot figyeli
int LED_PIN = 2;
void setup() {
WiFi.mode(WIFI_AP); //access point
WiFi.softAP("Hello_IoT", "12345678"); //ssid plusz jelszó
server.begin(); //192.168.4.1
//Looking under the hood
Serial.begin(115200); //Start communication between the ESP8266-12E and the monitor window
IPAddress HTTPS_ServerIP= WiFi.softAPIP(); // Obtain the IP of the Server
Serial.print("Server IP is: "); // Print the IP to the monitor window
Serial.println(HTTPS_ServerIP);
pinMode(LED_PIN, OUTPUT); //GPIO16 is an OUTPUT pin;
digitalWrite(LED_PIN, LOW); //Initial state is OFF
}
void loop() {
WiFiClient client = server.available();
if (!client) {
return;
}
//Looking under the hood
Serial.println("Somebody has connected :)");
//Read what the browser has sent into a String class and print the request to the monitor
String request = client.readString();
//Looking under the hood
Serial.println(request);
// Handle the Request
if (request.indexOf("/OFF") != -1){
digitalWrite(LED_PIN, HIGH); }
else if (request.indexOf("/ON") != -1){
digitalWrite(LED_PIN, LOW);
// THE HTML document
String S = "HTTP/1.1 200 OK\r\n";
S += "Content-Type: text/html\r\n\r\n";
S += "<!DOCTYPE HTML>\r\n<html>\r\n";
S += "<br><input type=\"button\" name=\"b1\" value=\"Turn LED ON\" onclick=\"location.href='/ON'\">";
S += "<br><br><br>";
S += "<input type=\"button\" name=\"b1\" value=\"Turn LED OFF\" onclick=\"location.href='/OFF'\">";
S += "</html>\n";
//Serve the HTML document to the browser.
client.flush(); //clear previous info in the stream
client.print(S); // Send the response to the client
delay(1);
Serial.println("Client disonnected"); //Looking under the hood
}
}Ezt a példát tettem fel a Wemos-ra. Ha simán az url mögé írom (192.168.4.1/ON vagy OFF) akkor megcsinálj. OFF esetén bedobja azt a honlapot is, ami bele lett írva a kódba. De tetű lassú, ezzel hogy lehet egy autót távirányítani? Rég nekiment volna már bárminek, mire veszi a következő utasítást.
Új hozzászólás Aktív témák
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Xbox Series X|S
- E-roller topik
- Battlefield 6
- VHS digitalizálás
- Spórolós topik
- Garmin Fenix 8 Pro - nézz az ég felé!
- Nintendo Switch 2
- Nothing Ear (3) - mikrofonpróba
- Telekom otthoni szolgáltatások (TV, internet, telefon)
- További aktív témák...
- Bomba ár! HP Revolve 810 G2 - i5-G4 I 8GB I 180GB SSD I 11,6" HD Touch I Cam I W10 I Garancia
- Eredeti Microsoft Windows 10 / 11 Pro OEM licenc Akciós áron! 64/32 bit Azonnali kézbesítéssel
- Lenovo ThinkPad T14 Gen1 Intel i5-10310U Refurbished - Garancia - Akció!
- Samsung Galaxy S23 Ultra Green 120 Hz Dynamic AMOLED 2X, 200 MP kamera, beépített S Pen
- Lenovo Legion Y540 - 15.6"FHD IPS 144Hz - i7 9750H - 16GB - 256GB SSD+1TB HDD - Win11 - GTX 1660 Ti
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Laptopműhely Bt.
Város: Budapest
ekkold

