The device is completely hand-made by our team: Cem, Mert, Can and Mehmet Can worked for two days to produce a cabinet that would house all the electronical components and would give the device a retro yet modern look. The production was made entirely out of scrap wooden planes that would have been thrown away otherwise; thus there were nearly no cost for mechanical production. 
After the initial assembly, Asli, Bensu and Selin painted and decorated the product to give it a stylish look. 




Controls

  • We decided to use rotary encoders -rotation detectors- and buttons for gameplay and navigation.
  • Each player has two buttons and one encoder with a separate button, which can be turned in clockwise or counterclockwise direction.
  • The two buttons and the encoder's button for each player are connected to the Raspberry Pi's GPIO pins with 10k pull-up resistors for increased stability.
  • The encoders, however, are first connected to an Arduino Pro Mini board that interprets the bit values it provides and transforms them into binary digital outputs for the Raspberry Pi. The Arduino board is also connected to the GPIO pins from where the Raspberry reads encoder data. 
  • Evaluating encoder data directly from the Raspberry is also possible. However, due to the unstable nature of encoders (giving a different set of values for each specific position) it is vital to read their data in as small intervals as possible. Doing this with the Raspberry is difficult and unnecessary. (It also greatly increased the CPU load in our trials) So the easier and more robust option was to put an Arduino board in between. In our next iteration we will replace the arduino and use smaller custom built ATtiny-85 encoder interpreter boards that we have designed. This will both reduce the form factor of our encoders and the overall price.

Display

  • The display is simply a sheet of paper with plastic film on it. Using an old projector, we display the image from our Raspberry Pi to the sheet.



As the Computer Science team in our school, we mostly focused on the code aspect of the Hisarcade. Our initial attempt at making a game started with the Pong game written in Processing by Mehmet Can. We added Arduino controls to it and used it on our first prototype. We used an Encoder library to read the 4-bit values that the encoder gave us. After the controls were done, Cem and Bensu coded Tetris and Snake for our arcade. Having some games ready, we decided to move the next step and start using the Raspberry Pi. However, the Raspberry Pi wasn't able to process the code as efficiently as we wanted. The game lagged severely despite the modifications we kept on doing to the code. Not being able to reduce the lag, we decided to learn a language that would work faster on Raspberry Pi. So, Bensu, Mehmet Can and Cem started to study Python as an alternative to Processing. Learning the essentials of Python in just a few days, they 
 converted our games to Python one by one. They used the PyGame module for graphics and the PySerial module for the connections with Arduino. With games coded in Python, the Raspberry Pi managed to achieve much better performance than before. After the performance improvements Mehmet Can coded a main menu to launch our games. The menu enabled us to launch any one of our games without accessing the desktop or any other interface. However, the games continued to lag and didn't provide the gaming 
experience that we hoped for. Even when we removed all the unnecessary bits in our code, we couldn't get a smooth gaming experience. We decided to cut out the middleman and get rid of the Arduino as the interpreter, and directly read the signals from Raspberry Pi's GPIO pins. We started to learn the GPIO libraries that would help us interpret both encoder and button values. We tried various libraries, but none of them was able to give us the accuracy we wanted. As a solution we programmed an Arduino to read the signals from the encoder. The Arduino would then send these signals directly to the GPIO pins of the Raspberry Pi, instead of the Serial port we used before. With these last modifications the performance of the Raspberry Pi improved dramatically. Our games can now satisfy our needs in terms of performance.


We are continuing to improve both the hardware and software of the HisArcade and will be updating this page and its sub pages as we proceed.
Comments