void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(12, OUTPUT);
pinMode(6, OUTPUT);
pinMode(3, OUTPUT);
pinMode(A0, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int val=analogRead(A0);
Serial.println(val);
if(val>100 && val<300){
digitalWrite(12, HIGH);
digitalWrite(6, LOW);
digitalWrite(3, LOW);
}
else if(val>300 && val<700){
digitalWrite(12, LOW);
digitalWrite(6, HIGH);
digitalWrite(3, LOW);
}
else{
digitalWrite(12, LOW);
digitalWrite(6, LOW);
digitalWrite(3, HIGH);
}
delay(100);
}