void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(8, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int A=map(analogRead(A2),0,1023,0,5);
Serial.println(A);
if (A<=2){
digitalWrite(8, HIGH);
}
else{
digitalWrite(8, LOW);
}
}