MouseShooter

Introduction

The MouseShooter is a BrickPi robot which can shoot LEGO balls and is controlled by a mouse for its movement and shooting the balls. 

You can use the mouse to move the arm around and when you are locked onto your target, just press your mouse to shoot the LEGO balls. 


Building a MouseShooter

The MouseShooter is an extension of the SriShooter.  Here are the links that will help you with the build:

Code

The code for the MouseShooter is available on our BrickPi Python Github Repository under the Project Examples.

To get the example code, just clone the BrickPi Python Repository:

If you don’t have Git installed, download and install it from here.

The example for the MouseShooter is Shooter_Robot_Mouse.py.


Usage

To start using the robot, first connect a USB mouse to the Raspberry Pi.

Once the mouse is connected, run Shooter_Robot_Mouse.py to start:

python mouseshooter.py

Move the mouse and if it was detected properly, the program will show "Values Updated" whenever you move the mouse.


Direction for Use

Move the mouse right to Rotate the arm Right. "Turn Right" displayed in terminal.

Move the mouse left to rotate the arm Left. "Turn Left" displayed in terminal.

Left Mouse Button Click to shoot the ball. "Shoot" displayed in terminal.

Right Mouse Button Click to stop the motors instantly. "Stop Everything" displayed in terminal.



Last modified: Monday, 30 November 2020, 6:22 PM