const int A = A4; int V = 0; int H = 3; int F= 4; int i=0; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode (H,OUTPUT); pinMode (F,OUTPUT); pinMode (A,INPUT); } void loop() { // put your main code here, to run repeatedly: V = analogRead(A); Serial.print("sensor = "); Serial.println(V); if (V<10){ digitalWrite (H,LOW); digitalWrite (F,LOW); } if (V>10 && V<20){ digitalWrite (H,HIGH); digitalWrite (F,LOW); } if (V > 20){ digitalWrite (H,HIGH); digitalWrite (F,HIGH); } delay(2); }