Yeah keypress detection wasn't working, I rejiggered it. If this works OK I can modify it to make it work more like a conventional RC car. As-is, it continuously follows the last command until you press something else:
Yeah keypress detection wasn't working, I rejiggered it. If this works OK I can modify it to make it work more like a conventional RC car. As-is, it continuously follows the last command until you press something else:
Warning (from warnings module): File "/home/pi/RC car code from gameboy.py", line 15 GPIO.setup(pwmpinL, GPIO.OUT) #set left motor's pin to output mode RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
Warning (from warnings module): File "/home/pi/RC car code from gameboy.py", line 16 GPIO.setup(pwmpinR, GPIO.OUT) #set right motor's pin to output mode RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
Warning (from warnings module): File "/home/pi/RC car code from gameboy.py", line 17 GPIO.setup(directionL, GPIO.OUT) #set right motor's pin to output mode RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
Warning (from warnings module): File "/home/pi/RC car code from gameboy.py", line 18 GPIO.setup(directionR, GPIO.OUT) #set right motor's pin to output mode RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. Use W/A/S/D to move, numbers 1~4 to adjust movement speed. Press C to exit Traceback (most recent call last): File "/home/pi/RC car code from gameboy.py", line 95, in getch = getChar() File "/home/pi/RC car code from gameboy.py", line 87, in getChar return getChar._func() File "/home/pi/RC car code from gameboy.py", line 74, in _ttyRead fd = sys.stdin.fileno() io.UnsupportedOperation: fileno
That error seems to be caused by the running the script from within IDLE, Make sure you're running straight from the terminal with "python gameboy.py"
https://stackoverflow.com/questions/31080829/python-error-io-unsupportedoperation-fileno
I assume you also get the GPIO.setup warnings with your own working test scripts?
You'll need to log in to post.