iam a new comer in arduino. curently learning through the examples. now iam learning the 'the case switch 2 statement. i need to send a char ' on' from serial port and to on an led. how can be this done.the practical problem is that i couldnt type more than a letter in the case statement. eg- case'on':
Post a picture of your keyboard with the on key circled, please.
If you can't, because your keyboard doesn't have an on key, then you need to reconsider what you are trying to do. In my case, my keyboard doesn't have an on key, so I would have to send two characters, 'o' and 'n', followed by some kind of delimiter (such as a carriage return), and have the Arduino read and store input until the delimiter arrived.
You have a choice to make. You must either make all your commands a single character or you must not use switch / case and use If / else if statements instead.
You could also build a table of acceptable commands, along with a corresponding constant, then have a function that returns the constant for any command parsed. Then, you can use the constant in a switch statement.