Does anyone know how to code a python script that will be able to achieve this WITHOUT pressing enter each time?
I am building a car powered by the RPi and I was wondering if this was achieveable. Here is what I have so far:
print "The controls are as follows: "
print "w = forward; a = left; s = backwards; d = right "
a = raw_input("Press a key to move the Robot: ")
while a:
a = raw_input("Press a key to move the Robot: ")
if a.lower() == 'w':
print "working forward"
if a.lower() == 'a':
print "working left"
if a.lower() == 's':
print "working backwards"
if a.lower() == 'd':
print "working right"
Any Idea how I would Modify this to do what I want?
BTW: I know how to get the GPIOs working but I can't test then in a shell, so I just used print functions/output.





