I need to update my global variable once I get a 'overdtrue' response and light up my LED but only my LED is lighting up but my global variable is not updated.
Here is my code
int x = 0;
void loop() {
if (content.indexOf("ovrdtrue") > 0)
{
x++;
digitalWrite(ledPin, HIGH);
}
fsrReading = analogRead(fsrAnalogPin);
Serial.print("Analog reading = ");
Serial.println(fsrReading);
Serial.print("X: ");
Serial.println(x);
}
The x value should be 1 but only the LED has light up. Please help.
if (content.indexOf("ovrdtrue") > 0)
- is itoverdtrue
orovrdtrue
?