Duck Hunt Game Using Arduino And Python

Osho Gera is an electronics hobbyist


Step 5

Save .whl files in a folder and install using pip. Type ‘C:\Python34\Scripts\pip’. Install [[PATH]]\[[FILENAME]].whl. And, import the package in Python shell. It should work properly.

Step 6

After installing Python and its libraries, test Python code. It is simple—code given with a set of images has to be kept in the same folder. Open the code; there is a variable called PORT. Change that COM port number as per your PC, after you have attached, Arduino board.

Step 7

Attach the USB cable and after uploading the code in Arduino, run Python code by pressing F5. This will open a GUI with four birds flying around on the screen and a scope view of a gun as shown in Fig. 1.

Step 8

The gun’s point can be changed by tilting the hardware, and bullets can be fired using S1.

Step 9

When you shoot while moving, the aim would not be accurate. After killing four birds, if time limit (150 seconds) is over, status of your game will be displayed on the screen.

Download source folder





Please enter your comment!
Please enter your name here