Pololu Pacman
This project uses two pololu 3pi+ 2040 robots to play Pacman. The user controls Pacman via keyboard, and the ghost chases Pacman. A projector and camera is set up above the board to read QR codes via computer vision to find Pacman, and to project orbs onto the board that Pacman “eats.” I’m working on the control and bluetooth side of the project.
Languages: First implementation using C for each robot with Python for scripting the game and sending serial coms via UART, then switched to Micropython for robots to complement the Python scripts.
Equipment: USB-to-TTL (x2), HSM-10 Bluetooth 4.0 BLE (x4).
Method: Run a Python script using pyserial and pygame libraries to read keyboard inputs and send keypresses via serial. A master bluetooth module is connected to the COM PORT via USB-to-TTL that is then set to auto pair with a slave module on the 3pi+ 2040 itself. The Bluetooth modules are in low power mode.
First test:
Testing keyboard inputs using Python script running pynput and pyserial. This implementation used C to controller the motors of the robot.
Second Test:
This is nearly identical, only this test uses Micropython and an early implementation of making the robot move only when a key is pressed, but we’ve since moved to mimic the Pacman experience by making Pacman move forward at all times, and only turning does anything.