---
logosub: "Avans TI student, year 3"
language: "jp"
title: "SWIV for Pi"
year: "2014"
date: "2014-01-01"
---

<div class="alert alert-warning" role="alert">
   <div>
<span>申し訳ありませんが、このページはまだ日本語に翻訳されていません。</span>
   </div>
</div>

A simple vertical space shooter created for the <a href="https://www.raspberrypi.org/" target="_blank" rel="noopener noreferrer">Raspberry Pi</a>. The game is played with regular keyboard and a custom joystick setup. The game was programmed in Python using the <a href="https://www.pygame.org/" target="_blank" rel="noopener noreferrer">PyGame</a> library. This project was mainly to create small game and interface it with a custom hardware setup. The setup uses an analog joystick to control the player's helicopter. An <a href="https://en.wikipedia.org/wiki/Analog-to-digital_converter" target="_blank" rel="noopener noreferrer">ADC (Analog Digital Converter)</a> samples the analog data into digital data so that the Raspberry Pi (version 1, type B) could parse the data.

<div class="d-flex justify-content-center">
  <img src="/images/software/projects/swiv-for-pi/title.webp" alt="S W I V for Pi title screen"/>
  <img src="/images/software/projects/swiv-for-pi/screenshot.webp" alt="S W I V for Pi screenshot"/>
</div>

## Hardware

Simple components were placed onto a breadboard and the joystick's analog resistive data would be converted into digital data. This data would be read by the GPIO pins and used to determine how the helicopter moves over the X- and Y-axis. To help with understanding electronic logic, an oscilloscope was used.

<figure class="text-center">
  <picture class="d-flex justify-content-center">
    <source
      media="(max-width: 510px)"
      srcset="/images/software/projects/swiv-for-pi/breadboard-top-view-w240.webp"
    />
    <source
      media="(max-width: 850px)"
      srcset="/images/software/projects/swiv-for-pi/breadboard-top-view-w480.webp"
    />
    <img
      src="/images/software/projects/swiv-for-pi/breadboard-top-view-w800.webp"
      alt="Breadboard with components top view"
      class="img-fluid"
    />
  </picture>
    <figcaption class="figure-caption mt-2">
    <a href="/images/software/projects/swiv-for-pi/breadboard-top-view-w800.webp">
      Breadboard with components top view
    </a>
  </figcaption>
</figure>

---

<figure class="text-center">
  <picture class="d-flex justify-content-center">
    <source
      media="(max-width: 510px)"
      srcset="/images/software/projects/swiv-for-pi/breadboard-front-view-w240.webp"
    />
    <source
      media="(max-width: 850px)"
      srcset="/images/software/projects/swiv-for-pi/breadboard-front-view-w480.webp"
    />
    <img
      src="/images/software/projects/swiv-for-pi/breadboard-front-view-w800.webp"
      alt="Breadboard with components front view"
      class="img-fluid"
    />
  </picture>
    <figcaption class="figure-caption mt-2">
    <a href="/images/software/projects/swiv-for-pi/breadboard-front-view.webp">
      Breadboard with components front view
    </a>
  </figcaption>
</figure>

---

<figure class="text-center">
  <picture class="d-flex justify-content-center">
    <source
      media="(max-width: 510px)"
      srcset="/images/software/projects/swiv-for-pi/oscilloscope-w240.webp"
    />
    <source
      media="(max-width: 850px)"
      srcset="/images/software/projects/swiv-for-pi/oscilloscope-w480.webp"
    />
    <img
      src="/images/software/projects/swiv-for-pi/oscilloscope-w800.webp"
      alt="Breadboard with components front view"
      class="img-fluid"
    />
  </picture>
    <figcaption class="figure-caption mt-2">
    <a href="/images/software/projects/swiv-for-pi/oscilloscope.webp">
      Oscilloscope
    </a>
  </figcaption>
</figure>
