Please how can I use a remote keyboard to drive the diablo motors? Thanks
piborg
Tue, 02/26/2019 - 18:01
Permalink
The easiest way would be to use the pygame keyboard library to read the keys: https://www.pygame.org/docs/ref/key.html
You can use this via SSH if X11 forwarding is enabled or with a wireless keyboard connected directly to the Raspberry Pi itself.
You should be able to modify the standard joystick example as a base and use the pygame.key.get_pressed() function to detect what keys are currently pressed each loop. There are some good examples here: https://www.pygame.org/docs/ref/key.html#comment_pygame_key_get_pressed
pygame.key.get_pressed()
piborg
Tue, 02/26/2019 - 18:01
Permalink
Getting keyboard input
The easiest way would be to use the pygame keyboard library to read the keys: https://www.pygame.org/docs/ref/key.html
You can use this via SSH if X11 forwarding is enabled or with a wireless keyboard connected directly to the Raspberry Pi itself.
You should be able to modify the standard joystick example as a base and use the
pygame.key.get_pressed()
function to detect what keys are currently pressed each loop. There are some good examples here: https://www.pygame.org/docs/ref/key.html#comment_pygame_key_get_pressed