Hi everyone, I would like to type/send a command to arduino, for it to correspondingly run a function. The code I have written is shown below, I am using the serial event structure. Except when I type a command for example "Move", arduino reads this in, but does not run the function I want it to run. Does any one know why?
You have not posted your complete program so I have no idea where the problem might be.
Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example.
It is not a good idea to use the String (capital S) class on an Arduino as it can cause memory corruption in the small memory on an Arduino. Just use cstrings - char arrays terminated with 0.