Hello everyone I wrote this code and I think there's a problem it says "expected initializer before numeric constant". This code uses force sensor as input data and after 50 presses on it it turn on the light.
int fsrPin = 0; // the FSR and 10K pulldown are connected to a0
int fsrReading; // the analog reading from the FSR resistor divider
int led 13
void setup(void) {
PinMode (led, OUTPUT);
Serial.begin(9600);
}
void loop(void) {
fsrReading = analogRead(fsrPin);
Serial.print("Analog reading = ");
Serial.print(fsrReading); // print the raw analog reading
Counter=0;
if (fsrReading >0) {
Counter=Counter+1;
if (x=50){
digitalWrite (LED,HIGH);
}
else{
digitalWrite (LED,LOW);
}
else{
}
delay(1000);
}