Giter Site home page Giter Site logo

reinbert / pca9685 Goto Github PK

View Code? Open in Web Editor NEW
59.0 11.0 27.0 39 KB

This software is a devLib extension to wiringPi http://wiringpi.com/ and enables it to control the Adafruit PCA9685 16-Channel 12-bit PWM/Servo Driver http://www.adafruit.com/products/815 via I2C interface.

C 77.09% Makefile 22.91%
raspberry-pi raspberrypi wiringpi pca9685 pwm servo servo-controller

pca9685's People

Contributors

gabo-tor avatar reinbert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pca9685's Issues

Examples do not run

Hello,
most of the example programms do not run because wiringPi is not initialisied

Neuroplant

prescaler value rounds down so frequency rounds up, so frequency can be too high

int prescale = (int)(25000000.0f / (4096 * freq) - 0.5f);

I replaced it with
ceil((25E6/4096) /freq) -1

This also removes one multiplication (although multiplying by 4096 is just shifting, but hey it is something).
This requires including math.h and linking against -lm.
An alternative would be:

#define CEILING(X) (X-(int)(X) > 0 ? (int)(X+1) : (int)(X))
CEILING((25E6/4096) /freq) -1

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.