Using a remote keyboard to drive the diablo motors

Forums:

Please how can I use a remote keyboard to drive the diablo motors?
Thanks

piborg's picture

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

Subscribe to Comments for "Using a remote keyboard to drive the diablo motors"