Giter VIP home page Giter VIP logo

raspberry-pi-dshot's Introduction

This project allows to generate DSHOT protocol to control ESCs via the
GPIO pins of a Raspberry Pi.  It was developed and used on Raspberry
Pi Zero 2, but should work on any Raspberry Pi 1/2/3/4.  It does not
work with Raspberry Pi 5. We have a more sophisticated implementation
with less CPU consumption at
https://github.com/Marian-Vittek/raspberry-pi-dshot-smi .

This implementation uses busy wait and 'clock_gettime' for timing and handles DSHOT 150
protocol well. It is running on standard Raspbian OS, no RT extension is
required. However, it may help if you use some hacks from
https://forums.raspberrypi.com/viewtopic.php?t=245561&sid=d3b2f6139ccf00a88aa7a98db2aed7f3
to reduce interrupts on a specific core.

This code is inspired by
https://github.com/dmrlawson/raspberrypi-dshot. Compared to it this
version:

- uses "clock_gettime" instead of an empty loop.
- allows multiple frames to be sent to multiple pins at once.

To compile and run a simple test that spins 4 motors connected to GPIO
16, 19, 20 and 21, type

    	   make test
	   sudo chrt -f 99 ./test 16 19 20 21

If it does not work you may need to edit 'motor-dshot.c' and adjust
DSHOT_BIT_ns and/or DSHOT_T0H_ns macro.

raspberry-pi-dshot's People

Contributors

marian-vittek avatar

Stargazers

Alexander avatar Vasyl Kilin avatar  avatar  avatar

Watchers

Kostas Georgiou avatar  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.