MouseShooter

MouseShooter

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 on to your target just press your mouse to shoot the LEGO balls.

Raspberry Pi Robot Shooter

Building the Mouse Shooter

The Mouse shooter 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,

git clone https://github.com/DexterInd/BrickPi_Python

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

The example for the Mouse Shooter is  Shooter_Robot_Mouse.py.

Usage

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

usb_conn

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 motors instantly. “Stop Everything” displayed in terminal.

python_output

{"cart_token":"","hash":"","cart_data":""}