Hi,
I'm a dad trying to help my 10 year old son run a robot off of the Raspberry Pi. The robot is running fine, but he would really prefer to drive it with the arrow keys. We have tried the getch() command a variety of ways including through the getch() module and the curses module. Unfortunately to program just kind of gets stuck when getch() is called. Example program using the getch() command is as follows.:
Import getch
print('Push an arrow key to drive the robot')
char = getch.getch()
print('Thank you')
This is just a test program to test the function. When this program is run, the shell window pops up, the cursor moves to the following line, "Push an arrow key to drive the robot" prints....and you can type in anything you want on the screen after that. Everything is echoed. However, the program never gets to the 4th line of the code, regardless of how many characters are input. "Thank you" never prints. It seems to get stuck in an infinite loop of some sort.
In order to stop the program, you must click the X in the upper right corner of the shell. When you do this, a pop-up lets you know that the program is still running and asks if you want to kill it.....so we kill it.
We have tried to use several of the options (objects) for the getch() command provided by forums online, but nothing seems to do what we want it to do. We are running Raspberry PI with Python 3.2.
We would appreciate any tips for making getch() work.
Thank you