How to compare string from Serial.read()?

后端 未结 6 2327
遇见更好的自我
遇见更好的自我 2021-02-09 11:07

I have this code below where I got from this forum that I followed through. It did not work for me but they claim that the code is fine. I already tried several string compariso

6条回答
  •  逝去的感伤
    2021-02-09 11:12

    I just use ' ' (single) instead of " " (double)

    char c = Serial.read();
    
    if (c == '1'){ //do something}  
    

提交回复
热议问题