Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Can someone tell me if this is a valid (i.e. sensible) statement
if (remote.scanf("%s", remcon)) {
remaction=atoi(remcon);
}
I am getting a string in via the sreial port (not the one connected to the USB lines). If its a valid string, I am assuming the statement evalues as TRUE and I then execute remaction=atoi(remcon). If it is not a string (so no \0 terminator), I go an execute the else which is to basically flush remcon. I then exit the serial ISR and go back to the main command processing loop.
Any help will be appreciated