int analogPin = A0; // Define the analog pin for the gas sensor
int threshold = 400; // Set a threshold value to trigger air quality warnings
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(analogPin);
Serial.println(sensorValue);
if (sensorValue > threshold) {
Serial.println("Air quality is poor! Open windows and ventilate.");
} else {
Serial.println("Air quality is good.");
}
delay(10000); // Delay for 10 seconds before the next reading
}