Comparing serial data with if statements in processing

thank you sir! You just saved my finals project!