Giter Site home page Giter Site logo

dadul96 / arduino-servo-hardware-pwm-library Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 2.0 234 KB

This library allows Arduino/Genuino Mega boards to control up to 9 servos with the integrated 16-bit hardware PWM timer/counter.

License: MIT License

C++ 100.00%
arduino arduino-library arduino-mega library servo pwm lib mega2560 pulse-width-modulation

arduino-servo-hardware-pwm-library's People

Contributors

dadul96 avatar per1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arduino-servo-hardware-pwm-library's Issues

detach() vs detachall()

If no pin number is required for detach() (per docs), how do you reference which servo to detach? And then, what is the difference between:

detach() — Clears the used registers and stops the output of the attached pin. (no pin number!)
detachAll() — Clears the used registers and stops the output of ALL attached pins. (no pin number!)

Use all 3 timer outputs for a timer

Wanted to use your library but noticed you are using the wrong WGM mode.

Using WGM mode 14 (FastPWM with IRCn as TOP) you can use all 3 timer outputs and no need to define the TOP value by sacraficing the ORCnA.

This works:

TCCR3A = (2 << COM3A0) | (2 << COM3B0) | (2 << COM3C0) | (1 << WGM31) | (0 << WGM30);
TCCR3B = (1 << WGM33) | (0 << WGM32) | (2 << CS30);
TCCR3C = 0;

ICR3 = 20000;

OCR3A = 1000;
OCR3B = 1500;
OCR3C = 2000;

DDRE |= (1 << PE3) | (1 << PE4) | (1 << PE5);

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.