Skip to content

NTUEE-ESLab/2019-AirHockey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2019-AirHockey

Overview

  • An air-hockey game implemented on STM32L475 and Raspberry Pi.
  • Two versions are available: BLE & Wifi
  • The Wifi version has better performance

Setup & Installation

Raspberry Pi

  • Prerequisites: bluepy (for ble) and pygame (ble and wifi)
$ pip3 install bluepy
$ pip3 install pygame

STM32L475

Prerequisites

BLE version

Wifi version

  • Move main.cpp into project (same directory as mbed-os/)
  • Substitute ssid and password in code below and copy it to mbed_app.json under project
{
    "config": {
        "wifi-ssid": {
            "help": "WiFi SSID",
            "value": "\"WIFI-SSID\""
        },
        "wifi-password": {
            "help": "WiFi Password",
            "value": "\"WIFI-PASSWORD\""
        }
    },
    "target_overrides": {
        "*": {
            "platform.stdio-convert-newlines": true
        }
    }
}
  • Change IP_ADDR in main.cpp:26-27 to the IP address of RPi

  • Compile and write into two boards. Remember to give two boards different PLAYER values (0 or 1)! (in main.cpp:30)

  • See STM32L475VG/wifi/README.md, for more information

How to Run

Raspberry Pi

BLE version

cd RPi/src/
sudo python3 main.py

Wifi version

cd RPi/src/
sudo python3 main-socket.py

STM32L475

Nothing has to be done! If the striker does not react or behaves strangely, press the blue button to reconnect and recalibrate.

After the commands are executed, you may enter the starting menu.
Enter 1, 3, or 5 to start the game (for 1, 3, or 5 minutes respectively).
Press Esc to exit the game.

Screenshots & Demo

References

For more information, see report for detailed implementation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published