How can I have the arduino recognizing incoming keys from the serial connection and do one action if the key is A and another action if the key is B?
just compare it's value with 'A' and 'B'
just be aware that 'A' is not equal to 'a'
That would make sense but I think that the letters get turned into some sort of ASCII codes. As they get turned in to ASCII they are put into a few different numbers not just one so it is hard to get working.
When you write 'A' in the Sketch code, the compiler knows that you mean the ASCII code for "A", and that's what you get. Try assigning a variable with, say, 'A' and printing it as an integer. You'll get 65, the ASCII code for a capital "A".
OK thanks