Giter Site home page Giter Site logo

seeed_pca9685's Introduction

Seeed PCA9685 Library Build Status


This is the Arduino Library for Seeed's PCA9685 based products. For now, it's Grove - 16-Channel Servo Driver(PCA9685).

Usage Tips


The PCA9685 is an I2C-bus controlled 16-channel LED controller. It can be used as RGB or RGBA LED Drivers, Servo Drivers, etc.

Please note that PCA9685 has a ALL CALL I2C-bus address 0x70, this address is for programming all the PCA9685s in the bus at the same time. This address is enabled by default and disabled after PCA9685::init() or ServoDriver::init().

Examples


Servo

This example drives 8 servos in turns. The library provides a sub-class of class PCA9685, named ServoDriver. In that class, ServoDriver::setAngle() can be used to control a servo directly.

Led

PCA9685 can also drive leds with PWM.

Change I2C address


The default I2C address of Grove - 16-Channel Servo Driver(PCA9685) is 0x7f. If you need to change the I2C address, there are 6 hardware address pin on the back and they are default to HIGH. Cut the line between the right two pads and solder the left two pads together to set it to LOW.

image

The following picture is the address table of PCA9685:

image


This software is written by Jerry Yip for seeed studio and is licensed under The MIT License. Check License.txt for more information.

Contributing to this software is warmly welcomed. You can do this basically by
forking, committing modifications and then pulling requests (follow the links above
for operating guide). Adding change log and your contact into file header is encouraged.
Thanks for your contribution.

Seeed Studio is an open hardware facilitation company based in Shenzhen, China.
Benefiting from local manufacture power and convenient global logistic system,
we integrate resources to serve new era of innovation. Seeed also works with
global distributors and partners to push open hardware movement.

Analytics

seeed_pca9685's People

Contributors

pillar1989 avatar jerryyip avatar lynnl4 avatar per1234 avatar

Stargazers

 avatar CKD avatar Victor Gwee avatar David MiZak avatar Rui Melo avatar  avatar

Watchers

Yoshihiro TSUBOI avatar Jedo avatar James Cloos avatar Albert Miao avatar  avatar Jack Shao avatar Old Tang avatar Oden.Su avatar BBear avatar  avatar  avatar  avatar Lakshantha Dissanayake avatar  avatar

seeed_pca9685's Issues

Where does the magic number 2.46 come from?

How do you get the formula min = (2.46 * min_pulse_width) / 10.0 - 1?

void ServoDriver::setServoPulseRange(uint16_t min_pulse_width, uint16_t max_pulse_width, uint16_t max_servo_degree) {
    float min, max;
    min = (2.46 * min_pulse_width) / 10.0 - 1;
    max = (2.46 * max_pulse_width) / 10.0 - 1;
    _min_pulse_width = min;
    _max_pulse_width = max;
    _max_servo_degree = max_servo_degree;
}

feature request: ServoDriver class: servo.setAngle(i, angle, rotationspeed)

feature request: ServoDriver class: servo.setAngle(byte i, int angle, float rotationspeed)
i: servo channel
angle: degrees (endpoint)
rotationspeed: degrees per second

e.g.,

servo.setAngle(i, 90); // let the servo move to position 90° immediately
delay(1000);
servo.setAngle(i, 180, 10.0); // moves the servo from the current position (90°) to position 180° by a rotation speed of 10°/sec

The function must not be blocking, so that a following command can be started immediately before the further movement has been finished (simultaneous movement)

servo.setAngle(1, 180, 10.0);
servo.setAngle(2, 45, 5.0);

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.