Giter Club home page Giter Club logo

gamesystem's Introduction

This repository contains a simple snake program implemented in c and gpio/analog in wrapper that is used to generate keypresses. Installation instructions below:

GPIO_Analog wrapper: This is a simple wrapper designed to read multiple gpio and analog pins, and generate keypresses based off of them. It requires the xdotools library, which you should be able to get with "opkg install xdotool". Before running please ensure analog inputs are enabled, by following these instructions:

beagle$ SLOTS=/sys/devices/bone_capemgr.*/slots beagle$ PINS=/sys/kernel/debug/pinctrl/44e10800.pinmux/pins beagle$ echo cape-bone-iio > $SLOTS

The wrapper can then be run, and will interpret inputs from the gpio pins listed inside, along with ain0 and ain1. Should you choose to edit the wrapper it can be recompiled with the included make file. The program is run with ./Wrapper. Keypresses will be sent to the currently selected window.

Warning!: Since this uses gpio polling, it will interfere with other programs using gpio polling when buttons are pressed

Hardware: 10 GPIO buttons and 2 variable potentiometers. This may be run with less hardware, and the pins are specified in the .c file. (along with pullup or pulldown, although we make no guarantees as to accuracy) Please use a pin diagram for this, and as pullup/pulldown may not be constant across generations please verify on your board. If a signal is not sent, it may be due to wiring issues.

Snake: In order to demonstrate our wrapper we set up a simple game of snake. It can be run by calling ./snake in the directory it is stored in, or remade by calling make. It is controlled by keyboard inputs, and requires enter to be pressed after each button press. This is dealt with automatically in the wrapper. WASD are used for directional controls, and p is pause. CTRL C is used to quit the game.

Hardware: Some means of generating keypresses, be it via our wrapper or a keyboard. Screen for output (note that it can be run properly through ssh)

gamesystem's People

Contributors

muglump avatar

Watchers

 avatar Ian Kowalski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.