If statement not working

Hi, i kinda new to arduino programming.
i am triyng to make a temperature sensor. i got it to work, but than i wanted to add a question trough serial monitor. When i tried to use the answer in the if statement, the the command in the if{} are ran no matter if it is true of false. Here is the code. Thanks

sketch_oct29c.ino (616 Bytes)

Hello,

If you put the code in the "Setup" subroutine, it will only run once at startup, then it will go into a continuous loop, and will execute only the sub "loop"

You can study the example serial event, after understanding, you should have no more doubts about how to receive the data through the serial port :wink: