Im trying to make a code where the arduino gets a string from the serial port and then gives back sensor data based on the string it got but i think that the arduino cant recognize the strings it gives me back the string i wrote and then says command not found
void loop() {
if (Serial.available()) {
String komut = Serial.readString();
Serial.print(komut);
if (komut=="gyro") {
getgyro();
}else if (komut=="altitude") {
getaltitude();
}else if (komut=="gps") {
getgps();
}else if (komut=="reset"){
I2Creset();
}else{
Serial.println("command not found");
}
}
}
this is the part where the problem is i made some custom voids and i call them based on the string it gets when i tried the custom voids and they work