void setup() {
// put your setup code here, to run once:
pinMode(3, OUTPUT);
pinMode(A0, INPUT);
Serial.begin(9600);
}
void loop() {
int a (analogRead(A0));
Serial.print("nilai=");
Serial.println(a);
if (a>500){digitalWrite(3, HIGH);}
else {digitalWrite(3,0);}
if (a>800){digitalWrite(4, HIGH);
}
else {digitalWrite(4,0);}
if (a>1000){digitalWrite(5, HIGH);
}
else {digitalWrite(5,0);}
}