I am doing a project where I must activate a system and then read a motion sensor and depending on whether the system is active or not, an action will be performed.
But the comparison of both variables (PIR and SISTEMON) is not working for me. I do not know if another syntax should be applied since when I do not compare the SISTEMON if the sensor reading works
Note: String.indexOf() returns -1 if the substring is not found. You are comparing to >0 so if the substring is found starting at the first character (character 0) you will count it as missing.