[Solved] C++ Trouble with operators () [closed]


You’ve got an else with no attached if.

Presumably, the println are supposed to be inside the following block, rather than being the entire body of the if statement:

if(ID.indexOf(msg)>=0)
{
  Serial.println("Access granted.");  // <<< inside if body
  digitalWrite(10, HIGH);
  delay(2000);
  digitalWrite(10, LOW);
}
else
{
  Serial.println("Access denied.");   // <<< inside else body
  digitalWrite(9, HIGH);
  delay(2000);
  digitalWrite(9, LOW);
}

solved C++ Trouble with operators () [closed]