.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,20 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Brett Hagman
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,137 +0,0 @@
|
||||
# SoftPWM Library #
|
||||
|
||||
----
|
||||
|
||||
## What's New? ##
|
||||
|
||||
Version 1.0.1
|
||||
|
||||
* Changes from Paul Stoffregen
|
||||
* Use IntervalTimer on Teensy 3.x
|
||||
* Use LED_BUILTIN for WLED in example
|
||||
|
||||
Version 1.0.0
|
||||
|
||||
* Initial release
|
||||
|
||||
## Description ##
|
||||
|
||||
A Wiring Framework (and Arduino) Library to produce PWM signals on any arbitrary pin.
|
||||
|
||||
It was originally designed for use controlling the brightness of LEDs, but could be modified to control servos and other low frequency PWM controlled devices as well.
|
||||
|
||||
It uses a single hardware timer (Timer 2 on AVR, or IntervalTimer on Teensy 3.x) on the microcontroller to generate up to 20 PWM channels.
|
||||
|
||||
----
|
||||
|
||||
## Features ##
|
||||
|
||||
* Arbitrary output pins
|
||||
* Up to 20 different channels can be created
|
||||
* True zero level, i.e. off == off
|
||||
* Separate fade rates for on and off
|
||||
|
||||
----
|
||||
|
||||
## Download and Installation ##
|
||||
|
||||
You can use the Arduino Library Manager (Sketch -> Include Library -> Manage Libraries...) to download the library.
|
||||
|
||||
Alternatively, you can download the library directly, and install it yourself.
|
||||
|
||||
* [SoftPWM Library - Latest Version](https://github.com/bhagman/SoftPWM/archive/master.zip)
|
||||
|
||||
Unzip the folder and rename it to `SoftPWM`, then move it to your `arduinosketchfolder/libraries/` folder.
|
||||
|
||||
----
|
||||
|
||||
## Usage Example ##
|
||||
|
||||
```
|
||||
#include "SoftPWM.h"
|
||||
|
||||
void setup()
|
||||
{
|
||||
// Initialize
|
||||
SoftPWMBegin();
|
||||
|
||||
// Create and set pin 13 to 0 (off)
|
||||
SoftPWMSet(13, 0);
|
||||
|
||||
// Set fade time for pin 13 to 100 ms fade-up time, and 500 ms fade-down time
|
||||
SoftPWMSetFadeTime(13, 100, 500);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
// Turn on - set to 100%
|
||||
SoftPWMSetPercent(13, 100);
|
||||
|
||||
// Wait for LED to turn on - you could do other tasks here
|
||||
delay(100);
|
||||
|
||||
// Turn off - set to 0%
|
||||
SoftPWMSetPercent(13, 0);
|
||||
|
||||
// Wait for LED to turn off
|
||||
delay(500);
|
||||
}
|
||||
```
|
||||
|
||||
----
|
||||
## Function Descriptions ##
|
||||
|
||||
`SoftPWMBegin([defaultPolarity])`
|
||||
|
||||
* Initializes the library - sets up the timer and other tasks.
|
||||
* optional `defaultPolarity` allows all newly defined pins to take on this polarity.
|
||||
* Values: `SOFTPWM_NORMAL`, `SOFTPWM_INVERTED`
|
||||
|
||||
`SoftPWMSet(pin,value)`
|
||||
|
||||
* `pin` is the output pin.
|
||||
* `value` is a value between 0 and 255 (inclusive).
|
||||
|
||||
`SoftPWMSetPercent(pin,percent)`
|
||||
|
||||
* `pin` is the output pin.
|
||||
* `percent` is a value between 0 and 100 (inclusive).
|
||||
|
||||
`SoftPWMSetFadeTime(pin,fadeUpTime,fadeDownTime)`
|
||||
|
||||
* `pin` is the output pin.
|
||||
* `fadeuptime` is the time in milliseconds that it will take the channel to fade from 0 to 255.
|
||||
* Range: 0 to 4000
|
||||
* `fadedowntime` is the time in milliseconds that it will take the channel to fade from 255 to 0.
|
||||
* Range: 0 to 4000
|
||||
|
||||
`SoftPWMSetPolarity(pin,polarity)`
|
||||
|
||||
* `pin` is the output pin.
|
||||
* `polarity` is the polarity for the given pin.
|
||||
|
||||
### Notes ###
|
||||
|
||||
* You can use `ALL` in place of the pin number to have the function act on all currently set channels.
|
||||
* e.g. `SoftPWMSetFadeTime(ALL, 100, 400)` - this will set all created channels to have a fade-up time of 100 ms and a fade-down time of 400.
|
||||
* The polarity setting of the pin is as follows:
|
||||
* `SOFTPWM_NORMAL` means that the pin is LOW when the PWM value is 0, whereas `SOFTPWM_INVERTED` indicates the pin should be HIGH when the PWM value is 0.
|
||||
|
||||
|
||||
----
|
||||
|
||||
## Demonstrations ##
|
||||
|
||||
Arduino Duemilanove LED Blink example - available as library example:
|
||||
|
||||
[](https://www.youtube.com/watch?v=9tTd7aLm9aQ)
|
||||
|
||||
rDuino LEDHead Bounce example - available as library example:
|
||||
|
||||
[](https://www.youtube.com/watch?v=jE7Zw1zNL6c)
|
||||
|
||||
More demos:
|
||||
|
||||
https://www.youtube.com/view_play_list?p=33BB5D2E20609C52
|
||||
|
||||
----
|
||||
@@ -96,42 +96,24 @@ ISR(TIMER1_COMPA_vect)
|
||||
// set all channels high - let's start again
|
||||
// and accept new checkvals
|
||||
for (i = 0; i < SOFTPWM_MAXCHANNELS; i++) {
|
||||
if (_softpwm_channels[i].fadeuprate > 0 || _softpwm_channels[i].fadedownrate > 0) {
|
||||
// we want to fade to the new value
|
||||
direction = _softpwm_channels[i].pwmvalue - _softpwm_channels[i].checkval;
|
||||
|
||||
// we will default to jumping to the new value
|
||||
newvalue = _softpwm_channels[i].pwmvalue;
|
||||
|
||||
if (direction > 0 && _softpwm_channels[i].fadeuprate > 0) {
|
||||
newvalue = _softpwm_channels[i].checkval + _softpwm_channels[i].fadeuprate;
|
||||
if (newvalue > _softpwm_channels[i].pwmvalue)
|
||||
newvalue = _softpwm_channels[i].pwmvalue;
|
||||
} else if (direction < 0 && _softpwm_channels[i].fadedownrate > 0) {
|
||||
newvalue = _softpwm_channels[i].checkval - _softpwm_channels[i].fadedownrate;
|
||||
if (newvalue < _softpwm_channels[i].pwmvalue)
|
||||
newvalue = _softpwm_channels[i].pwmvalue;
|
||||
}
|
||||
|
||||
_softpwm_channels[i].checkval = newvalue;
|
||||
} else // just set the channel to the new value
|
||||
_softpwm_channels[i].checkval = _softpwm_channels[i].pwmvalue;
|
||||
// check on pwm, 0-255
|
||||
_softpwm_channels[i].checkval = _softpwm_channels[i].pwmvalue;
|
||||
|
||||
// now set the pin high (if not 0)
|
||||
if (_softpwm_channels[i].checkval > 0) // don't set if checkval == 0
|
||||
if (_softpwm_channels[i].checkval > 0)
|
||||
{
|
||||
if (_softpwm_channels[i].polarity == SOFTPWM_NORMAL)
|
||||
*_softpwm_channels[i].outport |= _softpwm_channels[i].pinmask;
|
||||
else
|
||||
*_softpwm_channels[i].outport &= ~(_softpwm_channels[i].pinmask);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < SOFTPWM_MAXCHANNELS; i++)
|
||||
{
|
||||
if (_softpwm_channels[i].pin >= 0) // if it's a valid pin
|
||||
if (_softpwm_channels[i].pin >= 0) // Only set un-flagged pins
|
||||
{
|
||||
if (_softpwm_channels[i].checkval == _isr_softcount) // if we have hit the width
|
||||
{
|
||||
@@ -154,32 +136,17 @@ void SoftPWMBegin(uint8_t defaultPolarity) {
|
||||
// At these settings on a 16 MHz part, we will get a PWM period of
|
||||
// approximately 60Hz (~16ms).
|
||||
|
||||
uint8_t i;
|
||||
|
||||
//#ifdef WIRING
|
||||
// Timer2.setMode(0b010); // CTC
|
||||
// Timer2.setClockSource(CLOCK_PRESCALE_8);
|
||||
// Timer2.setOCR(CHANNEL_A, SOFTPWM_OCR);
|
||||
// Timer2.attachInterrupt(INTERRUPT_COMPARE_MATCH_A, SoftPWM_Timer_Interrupt);
|
||||
//#else
|
||||
// SOFTPWM_TIMER_INIT(SOFTPWM_OCR);
|
||||
//#endif
|
||||
|
||||
cli(); //Disable interrupts while setting registers
|
||||
TCCR1A = 0; // Make sure it is zero
|
||||
TCCR1B = 0; // Make sure it is zero
|
||||
//TCCR1B = (1 << WGM21); // Configure for CTC mode (Set it; don't OR stuff into it)
|
||||
//TCCR1B |= (1 << CS21); // Prescaler @ 1024
|
||||
// Hand init
|
||||
cli(); // Disable interrupts while setting registers
|
||||
TCCR1A = 0; // Reset the timer
|
||||
TCCR1B = 0; // Reset the timer
|
||||
TIMSK1 = (1 << OCIE1A); // Enable interrupt
|
||||
OCR1A = SOFTPWM_OCR; // compare value = 1 sec (16MHz AVR)
|
||||
|
||||
TCCR1B = (1 << CS21); /* start timer (ck/8 prescalar) */ \
|
||||
TCCR1A = (1 << WGM21); /* CTC mode */ \
|
||||
|
||||
OCR1A = SOFTPWM_OCR; // compare value
|
||||
sei();
|
||||
|
||||
|
||||
for (i = 0; i < SOFTPWM_MAXCHANNELS; i++) {
|
||||
for (uint8_t i = 0; i < SOFTPWM_MAXCHANNELS; i++) {
|
||||
_softpwm_channels[i].pin = -1;
|
||||
_softpwm_channels[i].polarity = SOFTPWM_NORMAL;
|
||||
_softpwm_channels[i].outport = 0;
|
||||
@@ -207,24 +174,20 @@ void SoftPWMSetPolarity(int8_t pin, uint8_t polarity) {
|
||||
}
|
||||
|
||||
|
||||
void SoftPWMSetPercent(int8_t pin, uint8_t percent, uint8_t hardset) {
|
||||
SoftPWMSet(pin, ((uint16_t) percent * 255) / 100, hardset);
|
||||
}
|
||||
|
||||
void SoftPWMSet(uint8_t pin, uint8_t value, uint8_t hardset) {
|
||||
|
||||
void SoftPWMSet(int8_t pin, uint8_t value, uint8_t hardset) {
|
||||
int8_t firstfree = -1; // first free index
|
||||
uint8_t i;
|
||||
|
||||
if (hardset) {
|
||||
SOFTPWM_TIMER_SET(0);
|
||||
_isr_softcount = 0xff;
|
||||
}
|
||||
|
||||
int8_t firstfree = -1; // first free index
|
||||
|
||||
// If the pin isn't already set, add it
|
||||
for (i = 0; i < SOFTPWM_MAXCHANNELS; i++) {
|
||||
if ((pin < 0 && _softpwm_channels[i].pin >= 0) || // ALL pins
|
||||
(pin >= 0 && _softpwm_channels[i].pin == pin)) // individual pin
|
||||
for (uint8_t i = 0; i < SOFTPWM_MAXCHANNELS; i++) {
|
||||
if (_softpwm_channels[i].pin == pin)
|
||||
{
|
||||
// set the pin (and exit, if individual pin)
|
||||
_softpwm_channels[i].pwmvalue = value;
|
||||
@@ -238,7 +201,7 @@ void SoftPWMSet(int8_t pin, uint8_t value, uint8_t hardset) {
|
||||
firstfree = i;
|
||||
}
|
||||
|
||||
if (pin >= 0 && firstfree >= 0) {
|
||||
if (firstfree >= 0) {
|
||||
// we have a free pin we can use
|
||||
_softpwm_channels[firstfree].pin = pin;
|
||||
_softpwm_channels[firstfree].polarity = _softpwm_defaultPolarity;
|
||||
@@ -257,23 +220,34 @@ void SoftPWMSet(int8_t pin, uint8_t value, uint8_t hardset) {
|
||||
}
|
||||
}
|
||||
|
||||
void SoftPWMEnd(int8_t pin) {
|
||||
uint8_t i;
|
||||
void SoftPWMEnd(uint8_t pin) {
|
||||
|
||||
for (i = 0; i < SOFTPWM_MAXCHANNELS; i++) {
|
||||
if ((pin < 0 && _softpwm_channels[i].pin >= 0) || // ALL pins
|
||||
(pin >= 0 && _softpwm_channels[i].pin == pin)) // individual pin
|
||||
{
|
||||
// now disable the pin (put it into INPUT mode)
|
||||
for (uint8_t i = 0; i < SOFTPWM_MAXCHANNELS; i++) {
|
||||
if (_softpwm_channels[i].pin == pin) {
|
||||
|
||||
// Disable pin output
|
||||
digitalWrite(_softpwm_channels[i].pin, 1);
|
||||
pinMode(_softpwm_channels[i].pin, INPUT);
|
||||
|
||||
// remove the pin
|
||||
// Flag as removed
|
||||
_softpwm_channels[i].pin = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SoftPWMEndAll() {
|
||||
|
||||
for (uint8_t i = 0; i < SOFTPWM_MAXCHANNELS; i++) {
|
||||
|
||||
// Disable pin output
|
||||
digitalWrite(_softpwm_channels[i].pin, 1);
|
||||
pinMode(_softpwm_channels[i].pin, INPUT);
|
||||
|
||||
// Flag as removed
|
||||
_softpwm_channels[i].pin = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SoftPWMSetFadeTime(int8_t pin, uint16_t fadeUpTime, uint16_t fadeDownTime) {
|
||||
int16_t fadeAmount;
|
||||
|
||||
@@ -51,8 +51,6 @@ void SoftPWMBegin(uint8_t defaultPolarity = SOFTPWM_NORMAL);
|
||||
|
||||
void SoftPWMSet(int8_t pin, uint8_t value, uint8_t hardset = 0);
|
||||
|
||||
void SoftPWMSetPercent(int8_t pin, uint8_t percent, uint8_t hardset = 0);
|
||||
|
||||
void SoftPWMEnd(int8_t pin);
|
||||
|
||||
void SoftPWMSetFadeTime(int8_t pin, uint16_t fadeUpTime, uint16_t fadeDownTime);
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
SoftPWM Library
|
||||
|
||||
Version Modified By Date Comments
|
||||
------- ------------ ---------- --------
|
||||
0001 B Hagman 2010-03-14 Initial coding (Pi Day!)
|
||||
0002 B Hagman 2010-03-21 License updates, minor fixes
|
||||
0003 B Hagman 2010-04-21 Added hardset control for syncing to matrix scan lines
|
||||
0004 B Hagman 2010-06-27 Fixed: pin 0 could not be used.
|
||||
0005 B Hagman 2011-05-27 Added polarity, and full Wiring support.
|
||||
B Hagman 2012-02-13 Fixed Arduino 1.0+ mess.
|
||||
1.0.0 B Hagman 2017-01-13 Initial release conforming to library standard.
|
||||
1.0.1 P Stoffregen 2017-08-30 Use IntervalTimer on Teensy 3.x and use LED_BUILTIN for WLED
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#include <SoftPWM.h>
|
||||
|
||||
void setup()
|
||||
{
|
||||
SoftPWMBegin();
|
||||
|
||||
SoftPWMSet(13, 0);
|
||||
|
||||
SoftPWMSetFadeTime(13, 1000, 1000);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
SoftPWMSet(13, 255);
|
||||
delay(1000);
|
||||
SoftPWMSet(13, 0);
|
||||
delay(1000);
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
#include <SoftPWM.h>
|
||||
|
||||
#define DELAY 100
|
||||
uint8_t leds[8] = {22, 23, 26, 27, 28, 29, 30, 31};
|
||||
|
||||
void setup()
|
||||
{
|
||||
SoftPWMBegin();
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
SoftPWMSet(leds[i], 0);
|
||||
|
||||
SoftPWMSetFadeTime(ALL, 50, 400);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
SoftPWMSet(leds[i+1], 255);
|
||||
SoftPWMSet(leds[i], 0);
|
||||
delay(DELAY);
|
||||
}
|
||||
|
||||
delay(400);
|
||||
|
||||
for (i = 7; i > 0; i--)
|
||||
{
|
||||
SoftPWMSet(leds[i-1], 255);
|
||||
SoftPWMSet(leds[i], 0);
|
||||
delay(DELAY);
|
||||
}
|
||||
|
||||
delay(400);
|
||||
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
#include <SoftPWM.h>
|
||||
|
||||
#define DELAY 40
|
||||
|
||||
uint8_t leds[8] = {22, 23, 26, 27, 28, 29, 30, 31};
|
||||
|
||||
void setup()
|
||||
{
|
||||
SoftPWMBegin();
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
SoftPWMSet(leds[i], 0);
|
||||
|
||||
SoftPWMSetFadeTime(ALL, 30, 200);
|
||||
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
SoftPWMSet(leds[i+1], 255);
|
||||
SoftPWMSet(leds[6-i], 255);
|
||||
SoftPWMSet(leds[i], 0);
|
||||
SoftPWMSet(leds[7-i], 0);
|
||||
delay(DELAY);
|
||||
}
|
||||
|
||||
delay(250);
|
||||
|
||||
for (i = 3; i > 0; i--)
|
||||
{
|
||||
SoftPWMSet(leds[i-1], 255);
|
||||
SoftPWMSet(leds[8-i], 255);
|
||||
SoftPWMSet(leds[i], 0);
|
||||
SoftPWMSet(leds[7-i], 0);
|
||||
delay(DELAY);
|
||||
}
|
||||
|
||||
delay(250);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
#include <SoftPWM.h>
|
||||
|
||||
#define DELAY 100
|
||||
uint8_t leds[8] = {22, 23, 26, 27, 28, 29, 30, 31};
|
||||
|
||||
void setup()
|
||||
{
|
||||
SoftPWMBegin();
|
||||
for (int i = 0; i < 8; i++)
|
||||
SoftPWMSet(leds[i], 0);
|
||||
|
||||
SoftPWMSetFadeTime(ALL, 50, 400);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
uint8_t pin = random(8);
|
||||
|
||||
SoftPWMSet(leds[pin], 255);
|
||||
delay(50);
|
||||
SoftPWMSet(leds[pin], 0);
|
||||
|
||||
delay(random(DELAY));
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
#include <SoftPWM.h>
|
||||
|
||||
#ifndef WLED
|
||||
#define WLED LED_BUILTIN
|
||||
#endif
|
||||
|
||||
void setup()
|
||||
{
|
||||
SoftPWMBegin();
|
||||
|
||||
// Sets the PWM value to 0 for the built-in LED (WLED).
|
||||
SoftPWMSet(WLED, 0);
|
||||
|
||||
// Sets the default fade time for WLED to
|
||||
// 100 ms fade-up and 550 ms to fade-down.
|
||||
SoftPWMSetFadeTime(WLED, 100, 550);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
// Turn on WLED
|
||||
SoftPWMSet(WLED, 255);
|
||||
// Wait for the fade-up and some extra delay.
|
||||
delay(250);
|
||||
// Turn off WLED
|
||||
SoftPWMSet(WLED, 0);
|
||||
// Wait for the fade-down, and some extra delay.
|
||||
delay(650);
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
########################################
|
||||
# Syntax Coloring Map For SoftPWM
|
||||
########################################
|
||||
#
|
||||
# Fields (Data Members) - KEYWORD2
|
||||
# Methods (Member Functions)
|
||||
# - FUNCTION2 (or KEYWORD2)
|
||||
# Constants - LITERAL2
|
||||
# Datatypes - KEYWORD5 (or KEYWORD1)
|
||||
########################################
|
||||
|
||||
########################################
|
||||
# Datatypes (KEYWORD5 or KEYWORD1)
|
||||
########################################
|
||||
|
||||
SoftPWM KEYWORD1
|
||||
|
||||
########################################
|
||||
# Methods and Functions
|
||||
# (FUNCTION2 or KEYWORD2)
|
||||
########################################
|
||||
|
||||
SoftPWMSet KEYWORD2
|
||||
SoftPWMSetPercent KEYWORD2
|
||||
SoftPWMSetFadeTime KEYWORD2
|
||||
SoftPWMBegin KEYWORD2
|
||||
SoftPWMEnd KEYWORD2
|
||||
SoftPWMSetPolarity KEYWORD2
|
||||
|
||||
########################################
|
||||
# Constants (LITERAL2)
|
||||
########################################
|
||||
|
||||
ALL LITERAL2
|
||||
SOFTPWM_NORMAL LITERAL2
|
||||
SOFTPWM_INVERTED LITERAL2
|
||||
@@ -1,9 +0,0 @@
|
||||
name=SoftPWM
|
||||
version=1.0.1
|
||||
author=Brett Hagman <bhagman@wiring.org.co>
|
||||
maintainer=Brett Hagman <bhagman@wiring.org.co>
|
||||
sentence=A software library to produce a 50 percent duty cycle PWM signal on arbitrary pins.<br />
|
||||
paragraph=A Wiring Framework (and Arduino) Library, for Atmel AVR8 bit series microcontrollers and Teensy 3.x, to produce PWM signals on any arbitrary pin.<br />It was originally designed for controlling the brightness of LEDs, but could be adapted to control servos and other low frequency PWM controlled devices as well.<br />It uses a single hardware timer (Timer 2) on an Atmel AVR 8 bit microcontroller (or IntervalTimer on Teensy 3.x) to generate up to 20 PWM channels (your mileage may vary).<br /><br />Issues or questions: <a href="https://github.com/bhagman/SoftPWM/issues">https://github.com/bhagman/SoftPWM/issues</a><br />
|
||||
category=Signal Input/Output
|
||||
url=https://github.com/bhagman/SoftPWM
|
||||
architectures=avr,arm
|
||||
Reference in New Issue
Block a user