Infineon-DIY Arcade Gaming Station-UserManual-v01 00-EN

Download as pdf or txt
Download as pdf or txt
You are on page 1of 36

DIY Arcade Gaming Station

Hardware
Housing

› The housing of the arcade demonstrator is


completely built with a laser cutter

› The used material for the control panel is


Plexiglas (4 mm), the rest is built with 4 mm
wood

› To rebuild the setup you need a laser cutter,


glue, vice clamps

› Don’t glue everything together right away after


cutting as you need to have access to the
inside for installing the electronics. Start with
the side walls and the middle plate only.

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 3


Mechanics: Buttons
Movable button with feets
Button housing (not moving)

Magnet inside housing replaces feather and provides better haptic feeling:
It pulls metal sheet upwards which moves the button back up after it was pushed

Sensor PCB (TLE4964-3M Shield2Go)


(Not moving)

Pushing the button moves the sensor magnet below the sensor -> sensor output toggles

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 4


Mechanics: Buttons

Magnet is hold in place by 3D printed part „Button Magnet Mount.stl“

Any thin ferromagnetic metal sheet can be used here

Sensor PCB is mounted via 3D printed part


„Hall Switch Button Mount.stl“

Sensor magnets are as well hold in place by 3d printed part „Hall Switch Button Mount.stl“

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 5


Mechanics: Joystick

• In the demonstrator a joystick is used that is quite


expensive, therefore we recommend to use our
3D printed joystick and modify the control panel
so the joystick can be attached to it

• You also need a magnet (cube : 5 x 5 x 5 mm)

• It is also possible to use another joystick with


some modification which makes it possible to
read out the position with the 3D-Magnetic-
Sensor, for example this one :
https://www.conrad.de/de/p/joy-it-arcade-joystick-
professional-8-eingabegeraet-passend-fuer-
einplatinen-computer-arduino-banana-pi-
cubieboard-1555268.html. This one has also the
arcade optic 

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 6


Electrics

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 7


Install Software
Install Software

1. Download ISO file


2. Place on >= 16GB micro sd card and put into Raspberry Pi
3. Power up Raspberry Pi and enter Raspbian OS
(see next slides in „User Manual“)
– Via Hotspot + SSH
– Via Touchscreen -> Desktop
4. Config Raspbian OS: Wifi, Password, etc.
5. Reboot and enjoy

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 9


User Manual
Arcade Overview

› Touchscreen

› Buttons with TLE4964 Hall Switch


(in Shield2Go format)

› Joystick with TLE493D-W2B6


Shield2Go

› Raspberry Pi 4 + Infineon
Shield2Go Adapter

› Merus Audio Amplifier (on


Raspberry Pi Hat)

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 11


Games

› Games selectable via


Touchscreen:
– Aliens (like Space Invaders)
– Super Minio (basically first level
of Super Mario Bros)
– Domikon (like Donkey Kong)
– Nikman (like Pacman)
– Mitris (like Tetris)

› Also selectable via Touchscreen:


– Highscore lists for each game
– One overall highscore with
special factor for each game to
make them comparable. Factors
can be adjusted in Software
code.

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 12


Usage

› Directly after booting, the menu can be seen and music should be played.
Otherwise: Reboot (described in chapter „Hotkeys“)
› After 5 minutes with no action the overall highscore shows up as
screensaver. It can be ended by pressing A, B or the touchscreen
› The Demo can be controlled by some button/joystick/touchscreen
combinations (furhter referred to as „Hotkeys“)

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 13


Hotkeys

› Controlling the sound:


– Sound on:
‚B‘ + Joystick down + tap on any game in main menu
– Sound off:
‚B‘ + Joystick up + tap on any game in main menu
Note: you can boot up in silent mode by holding this combination during
startup (until the menu shows up)
› Shutdown or restart:
First select any main menu item, so that you have the button „Back“ on
the screen.
– For Shutdown:
‚A‘ + ‚B‘ + Joystick left + „Back“ on touchscreen
– For Restart:
‚A‘ + ‚B‘ + Joystick right + „Back“ on touchscreen

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 14


Configuration interfaces

› There are two ways on how to gain control over the demo (basically how
to access the raspberry-pi operating system):

1. SSH (wireless via network)

2. Hotkey to exit the Arcade Menu and show the Raspberry-Pi-Desktop

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 15


SSH (access via network)

› Create a Hotspot with e.g. your smartphone:


SSID: „iPhone“
Password: „Arcade2020“
The raspberry pi will then connect to this network. To open a SSH-shell
you need to connect your computer to this hotspot, too. Then open
PUTTY and connect to „Arcade2020“.

› For login you need the credentials:


User: pi
Password: Arcade2020

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 16


Shortcut to Raspberry-Pi-Desktop

› Hotkey: ‚A‘ + ‚B‘ + Joystick up + „Back“ on touchscreen

› The menu will close and the normal Raspberry pi desktop appears. Here
you have full control of the demo.

› On the Desktop there is a script which resets the highscore („reset.sh“).


Use the touchscreen to execute it and all highscores will be deleted.

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 17


Control volume

› If the volume needs to be adjusted:


– Connect to the Raspberry pi via SSH as described previously, then
login.
– Type „alsamixer“ in the console
– Adjust „Master Volume“ (First column: „A“) via the arrow keys of your
keyboard

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 18


How to add an own game
Download Pygame (e.g. from github)

› Example links of current games:


› https://github.com/greyblue9/pacman-python
› https://github.com/justinmeister/Mario-Level-1
› https://github.com/erilyth/DonkeyKong-Pygame
› https://github.com/rajatdiptabiswas/tetris-pygame/
› -> exchanged all problematic graphics and sounds with media from
https://opengameart.org/ in order to be legally allowed to show this demo
on trade shows
› Also used: Aliens which comes already with Raspbian OS

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 20


Edit downloaded game

› copy Arcade/controls/joystick.py and .../buttons.py to game folder

› edit game file(s): - find file where keyboard is read (search for
pygame.key.get_pressed())
– at beginning: import joystick and buttons
– Init joystick and buttons
– after key.get_pressed():
– read joystick and buttons
– edit key map accordingly (e.g. if joystick.X < -0.3: LEFT_KEY = true)

› save & exit pygame script

› See next slides for details

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 21


Copy joystick and button modules to game folder

Example Game: Aliens


Source: /home/pi/Arcade/Games/controls in folder: /home/pi/Arcade/Games/Aliens

Copy

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 22


Edit game file: import modules

› Import previously copied joystick


module

› Import previously copied button


module

› Some defines (Here: Which slot of


the Shield2Go-Adapter is the
shoot-button connected to?)

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 23


Edit game files: Change keyboard input
Find pygame.key.get_pressed() in game script and add:
› Keyboard is read into array (tuple)

› Reading joystick

› Converting tuple to list

› Interpreting joystick as keyboard


inputs and overwriting keyboard-
array

› Reading buttons and overwriting


keyboard-array

› Converting list back to tuple

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 24


Test game

› Test game: exit menu via hotkeys and start game manually from Desktop
(Touchscreen)
› If not already done: make game fullscreen

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 25


Include Game into touchscreen menu

› /home/pi/Arcade/Menu/pimenu.ya › /home/pi/Arcade/Menu/pimenu.sh
ml

Get player name


(for highscore)

Start game

List highscore

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 26


Include Game in Highscores

› Edit game to manage highscores (open file, read current highscore,


compare new score, save new highscore, etc.)
› Edit Arcade/Highscore/list.py to show new highscore
› Find and implement scaling factor for comparison with other games
(Overall Highscore)

› See next slides for details

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 27


Highscore: define paths

Edit according to your game

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 28


Highscore functions: get_highscore()

You can copy this from existing games (like Aliens)

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 29


Highscore funtkons: update_highscore
Replace this with the variable
which holds the score of your game

You can copy this from existing games (like Aliens)

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 30


Highscore functions: get_player_name()

You can copy this from existing games (like Aliens)

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 31


Include highscore-functions in game logic

› Find the place in the game where it‘s best to run the highscore functions
› Here: At the end of the gaming script (so it just runs once at the end of a game)

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 32


Highscore: include into list.py

› Edit /home/pi/Arcade/highscores/list.py

› Define new list-function:

Replace these with the name of your game

› Include in main():

Name of your new list-function

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 33


Edit list.py for overall-highscore

› Edit listOverall():

Copy/paste, then
edit according to
your game
other games are left out here for better readability

› Add Game-Score-Multiplier for overall highscore:

Multipliers are defined


before the first function

Add an own multiplier for your game


to make it comparable with the other games

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 34


Enjoy 

2020-07-30 Copyright © Infineon Technologies AG 2020. All rights reserved. 35

You might also like