I know this is a basic question, but as a hardware electronics guy and not a programmer I cannot seem to fathom how to do this - so any examples of code would be greatly appreciated:
I want the arduino to spit out some initialization chatter on startup - (ok, done easy).
Then I want it to listen for serial commands, they can all be same length if that helps but I want them to be strings. i.e. identifier followed by value
Command --- Result
PWR_TRUE --- Power on device
PWR_FLSE --- Power off device
REP_FREQ --- Print frequency over serial
SP000752 --- Set power value to 752
SP016675 --- Set power value to 16675
Obviously the commands are two types, the first two being booleans and then integers, but I cant seem to find any examples not working off a single ascii character value, which is useless to me. I need more information and then from the message be able to break it down into something the arduino does.
An example of how to import whole commands and either do something, and / or chop the command up to get the value out, would be most useful.
Many thanks in advance :)
EDIT/UPDATE: I now seem to have found a solution thanks to Edgar as given in the comments. However I now have another question relating to updating the variables so as to effect the loop, as well as performing actions upon receipt of commands (which itself now works) LINK HERE