/*Write a program to interface any analog (pollution)
sensor and display
the values read on serial monitore*/
int sensorvalue;
int digitalvalue;
void setup() {
Serial.begin(9600);
pinMode(13,OUTPUT);
pinMode(3, INPUT);// put your setup code here, to run once:
}
void loop() {
sensorvalue=analogRead(0);
digitalvalue=digitalRead(2);
if(sensorvalue>400){
digitalWrite(13, HIGH);
}
else{
digitalWrite(13, LOW);
Serial.println(sensorvalue,DEC);
Serial.println(digitalvalue,DEC);
delay(1000);
}
// put your main code here, to run repeatedly:
}