Giter Site home page Giter Site logo

m8c-rpi-gpio's Introduction

Hardware Key Mapping via GPIO for Dirtywave m8 rPi

Description

This is a simple python script that maps the GPIO pins of a Raspberry Pi to keyboard keys for use with the Dirtywave m8 headless tracker on a Raspberry Pi 4.

See https://github.com/RowdyVoyeur/m8c-rpi4 for details on that project.

Main Controls

gpio-hw-keyboard.py maps the GPIO pins to keyboard keys to control the m8c.

26: "up",
19: "right",
13: "down",
6: "left",
21: "a", #option
20: "s", #edit
16: "z", #shift
12: "x", #play

Volume Up/Down

gpio-volume-control.py maps the GPIO pins to volume control buttons.

23: Volume Up
24: Volume Down

Shutdown

listen-for-shutdown.py and listen-for-shutdown.sh are used to listen for a button press to shut down the rPi. This is intended to be used with a momentary switch connected to GPIO pin 3 and ground.

Install with:

./m8c-rpi-gpio/script/install

Installation

Install required packages at root

sudo pip3 install keyboard pyalsaaudio

Copy the service file to systemd

sudo cp ~/m8c-rpi-gpio/m8c-rpi-gpio.service /etc/systemd/system/m8c-rpi-gpio.service

Enable and start the service

sudo systemctl daemon-reload
sudo systemctl enable m8c-rpi-gpio.service
sudo systemctl start m8c-rpi-gpio.service

Usage

sudo python3 main.py

m8c-rpi-gpio's People

Contributors

jhob101 avatar

Watchers

 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.