int value = 0;
float voltage;
void setup(){
pinMode(0, OUTPUT);
analogReference(INTERNAL); // switch to 1.1volt Aref
}
void loop(){
value = analogRead(A2);
voltage = value;
if (voltage >= 1023 ) {
digitalWrite(0, HIGH);
} else {
digitalWrite(0, LOW);
}
delay(500);
}