This is an old revision of the document!
This project aims to build a setup based on a servomechanism and a sensor MQ-5, with the purpose of opening a window in case the gas concentration rises above a desired value.
Code snippets
#include <WiFi.h> #include <WebServer.h> #include <ESP32Servo.h> const char* ssid = ""; const char* password = ""; #define ANALOG_PIN 34 // Pinul conectat la AO al senzorului MQ-4 #define SERVO_PIN 13 // Pinul conectat la servomotor int valoare_analogica = 0; String nivelGaz = ""; String culoareNivel = "green"; bool servoActiv = false; bool modAutomat = true; int pragActivare = 800; Servo myservo;
Figuring out a way to design the webpage to allow me to switch the servomechanism to “automated” or “manual” mode.
-