Posts

This ESP32 Powred Robot That Follows My Hand!

Image
Paste This Code on Your Arduino IDE   #include <ESP32Servo.h> // 3 Servo objects banayein Servo servo1; Servo servo2; Servo servo3; // --- Pins Setup --- const int servoPin1 = 18; const int servoPin2 = 21; const int servoPin3 = 22; const int trigPin = 5;   const int echoPin = 19; // --- Speed Variables --- int forwardSpeed = 1600; int stopMotor = 1500;     void setup() {   // Teeno servo ko attach karein   servo1.attach(servoPin1);   servo2.attach(servoPin2);   servo3.attach(servoPin3);     // Sensor Setup   pinMode(trigPin, OUTPUT);   pinMode(echoPin, INPUT);     Serial.begin(115200);   Serial.println("3 Servos Ready!");     // Shuru mein teeno ko rok kar rakhein   servo1.writeMicroseconds(stopMotor);   servo2.writeMicroseconds(stopMotor);   servo3.writeMicroseconds(stopMotor); } void loop() {  ...

ESP32 Captive Portal Search Engine Code

Image
Paste This Code on Your Arduino IDE   #include <WiFi.h> #include <DNSServer.h> #include <WebServer.h> #include <HTTPClient.h> #include <WiFiClientSecure.h> #include <ArduinoJson.h> // ---------------- USER CONFIGURATION ---------------- // Backend Router (Internet connection for ESP32) const char* sta_ssid = "Airtel_X";       // Aapka router ka naam const char* sta_pass = "Gau@0369";    // Aapka router ka password // ESP32 Access Point (Network name for users) const char* ap_ssid = "ESP32 SEARCH ENGINE";        // AP Name jo mobile mein show hoga // ---------------------------------------------------- const byte DNS_PORT = 53; DNSServer dnsServer; WebServer server(80); // Function to safely encode search queries for URL (e.g. "Elon Musk" -> "Elon%20Musk") String urlEncode(String str) {   String encodedString = "";   char c;   char code0;   char code1;  ...

Offline chatting using a ESP32 code

Image
Paste This Code on Your Arduino IDE #include <WiFi.h> #include <DNSServer.h> #include <WebServer.h> #include <vector> // Wi-Fi Configuration (Open Network) const char* ssid = "FREE CHAT"; // DNS and Web Server Settings const byte DNS_PORT = 53; IPAddress apIP(192, 168, 4, 1); DNSServer dnsServer; WebServer server(80); // Structure to store messages struct Message {   String sender;   String text; }; std::vector<Message> chatHistory; const size_t MAX_MESSAGES = 15; // Image support ke liye memory limit ko 15 kiya taaki crash na ho // JSON Escape helper to handle special characters and long strings safely String escapeJSON(String input) {   input.replace("\\", "\\\\");   input.replace("\"", "\\\"");   input.replace("\n", "\\n");   input.replace("\r", "");   return input; } // HTML, CSS, aur JavaScript (With Image Compression & Upload Feature) const char HT...