void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(2, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
float sensor=analogRead(A0);
Serial.print("sensor value :" );
float sensor1=((sensor*5/1023));
Serial.print(sensor1," V ");
Serial.println("V ");
if(sensor1 >= 3)
{
digitalWrite(2, HIGH);
}else
{digitalWrite(2, LOW);}
delay(100);
}