Malfunctioning if statement

Actually your check for > 0 would not yield true when the string starts with trigger, you rather want to check for >= 0
https://docs.particle.io/reference/firmware/photon/#indexof-

Also the omitted code may well interfere with your subsequent checks, so you need to browse for any instance where Pressure could be reset to 0 or double check your indicator logic - maybe it's just not reset when the condition is not met - at least the way how you indicate the met condition would be good to see :wink:

@HEng, I've reformatted the code block, but actually the preformatted text feature isn't the right one to use for blocks of code. For these you'd use a line with ```cpp before the block of code and with ``` after (each by itself without any leading or trailing whitespace)

For more infor about the formatting features of Discourse (with which this forum is built) can be found here

1 Like