I'm coding my BB-8 project and I'm using bluetooth with my Arduino so I'm using:
if (Serial.available() > 0) {
state = Serial.read();
Most people send numbers through like this which works:
if (state == '1') {
But I would like to send a string through instead, of a number to make it easier like this:
if (state == 'stop') { // or go etc.
But this doesn't seem like it would work so I tried using a string:
if (state == "stop") {
But I get this error
ISO C++ forbids comparison between pointer and integer [-fpermissive]
Which one would work and if neither what should I do instead?
Thank you.