

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


#include #include const char* ssid = "Wokwi-GUEST"; const char* password = ""; int pir = 13; void setup() { Serial.begin(115200); pinMode(pir, INPUT); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); } Serial.println("WiFi Connected"); } void loop() { int motion = digitalRead(pir); HTTPClient http; String url = "http://httpbin.org/get?motion=" + String(motion); http.begin(url); http.GET(); http.end(); if (motion) { Serial.println("Motion Detected"); } else { Serial.println("No Motion"); } delay(2000); }