kenter1 / flystick

USB joystick to PPM using Raspberry Pi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flystick

A python script for Raspberry Pi that reads a USB joystick (with pygame) and outputs a PPM signal to RC transmitter (with pigpio).

For the mandatory blinky-blinky, supports VERY FANCY (or so) visualizations for Scroll pHAT.

The input/output-mapping and visualization are highly configurable.

YouTube screenshot

Motivation

I wanted to try out how it's to fly FPV with a joystick. Project https://github.com/Iezious/rcjoy/wiki did seem very interesting, but I wasn't that thrilled about the low-level, hardware-specific approach; I wanted a simpler and more future-proof solution.

When the Raspberry Pi Zero came out, it seemed like a perfect hardware component for solving the problem. And then with the python libraries, the whole set came together very nicely — with very little code.

Setup (on Raspberry Pi)

Installation

  1. sudo apt-get install python-pygame git

  2. http://abyz.co.uk/rpi/pigpio/download.html -> Updated Website https://abyz.me.uk/rpi/pigpio/download.html

  3. Optional: from https://github.com/pimoroni/scroll-phat:

    curl -sS https://get.pimoroni.com/scrollphat | bash

  4. git clone https://github.com/jsa/flystick.git

Configuration

  1. Calibrate joystick, see jscal. Also the related jstest, jscal-store, and jscal-restore.

  2. Configure channel mapping.

  3. Configure Pi for safe unplugging.

  4. Insert to /etc/rc.local BEFORE THE LINE exit 0:

Requires Python 2 - Run using python2

pigpiod

cd ~pi/flystick
python flystick.py &
cd -

Wiring

  1. 5V → Raspberry Pi

  2. Raspberry PPM output → transmitter trainer port

About

USB joystick to PPM using Raspberry Pi

License:GNU General Public License v3.0


Languages

Language:Python 100.0%