int pin8 = 8;
int sensor = A0;
int sensorvalue = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(pin8, OUTPUT);
pinMode(A0, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
sensorvalue = analogRead(sensor);
Serial.println(sensorvalue, DEC);
if (sensorvalue > 130) {
digitalWrite(pin8, HIGH);
}
else {
digitalWrite(pin8, LOW);
}
delay(1000);
}