const int led=11;
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int sensor=analogRead(A0);
int a=sensor*5/1024;
Serial.print("Sensor value is :");
Serial.println(a);
if(a>=3){
Serial.println("led is turn On");
digitalWrite(led, HIGH);
}
else{
Serial.println("led is turn Off");
digitalWrite(led, LOW);
}
}