Pauls,
Thanks for your inputs now and for some other times that you helped me. I am going to include more function calls in the loop. What I want is to get from this function the key pressed, in the IR command, display it and use it to do other stuff, like get the number of degrees to run the motor, etc.
Thanks
Manuel