//lets check if LED should be lighted if (readString.substring(Ae,(Ae+3)) == "A=1") { //led has to be turned ON digitalWrite(A_pin, HIGH); // set the LED on //Serial.println("A_pin paa"); Ledstatus[0] = true; } if (readString.substring(Ae,(Ae+3))== "A=0") { //led has to be turned OFF digitalWrite(A_pin, LOW); // set the LED OFF //Serial.println("A_pin av"); Ledstatus[0] = false; }