Simple Pokedex

by yuaj in Craft > Digital Graphics

494 Views, 3 Favorites, 0 Comments

Simple Pokedex

IMG_7233.jpg

A simple project focused more on the coding side the simple Pokedex can display a random pokemon or one of your choice and give you its stats, typing, ability, and base stats. It will also play a sound for the first 721 pokemon.

Supplies

Not many materials are needed for this and most will be focused on the coding side.

For physical materials:

  • Raspberry Pi
  • Raspberry Pi-supported touchscreen capable display
  • Access to a laser cutter

For packages needed on the coding side:

  • Tkinter
  • Simpleaudio
  • requests
  • random
  • Pokemon API for information and images
  • Veekun for pokemon sounds

Attach Raspberry Pi to Touchscreen

IMG_7234.jpg

Attach the raspberry pi to the touch screen. My version used a ribbon connection and attach the pi itself with standoffs and screws. Some versions require an HDMI connection.

Code

The code represents the main buck of this project. I will do some simple explanations


API Requests

API requests are done through the format

response = requests.get("http://apiname").json()

This reads the API and produces a dictionary that is then passed to the print stats function that pulls the stats from the dictionary


Creating the UI

The UI is created through Tkinter. Most of this was done following the example on the TkDocs website and adapting to my own use. Here is the link to the page.


Playing Sound

Veekun provides the sounds in a .ogg format which was hard to find any supported audio players on python. As such, I created an auxiliary file that went through the folder and converted all the files from .ogg to .mp3 which are in the sound file


Git Files

Here are all files uploaded on git.

https://github.com/ColinYu2024/simple-pokedex


Creating the Box

IMG_7239.jpg
IMG_7237.jpg
IMG_7238.jpg
IMG_7236.jpg

The box cut file was gotten from fest.info/boxes.py. The box file itself was console 2 and was modified with a slot in the front cut out for the touch display.

After cutting, the box can be assembled easily. In the main compartment, the Raspberry Pi is connected to a speaker and an external phone battery to provide power.

Demo

Simple Pokedex