Skip to content

Commit

Permalink
add changelog.md (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart authored Nov 19, 2022
1 parent 9696989 commit 234e73e
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 43 deletions.
19 changes: 18 additions & 1 deletion .arduino-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
platforms:
rpipico:
board: rp2040:rp2040:rpipico
package: rp2040:rp2040
gcc:
features:
defines:
- ARDUINO_ARCH_RP2040
warnings:
flags:

packages:
rp2040:rp2040:
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

compile:
# Choosing to run compilation tests on 2 different Arduino platforms
platforms:
Expand All @@ -8,4 +23,6 @@ compile:
- m4
- esp32
# - esp8266
# - mega2560
# - mega2560
- rpipico

64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Change Log PCA9685

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.4.1] - 2022-11-19
- add RP2040 in build-CI
- add changelog.md


## [0.4.0] - 2022-06-09
- breaking changes (sync with pca9634)
- rename reset() to configure()
- add mode1 and mode2 parameter to configure.
- add SUB CALL and ALL CALL functions.
- update documentation.
- renamed PCA9685_MODE2_STOP to PCA9685_MODE2_ACK
- add mode parameters to begin()

----

## [0.3.4] - 2022-01-03
- add channelCount()

## [0.3.3] - 2021-12-23
- update library.json
- license
- readme
- minor edits

## [0.3.2] - 2021-01-14
- WireN support

## [0.3.1] - 2021-01-05
- Arduino-CI + unit test

## [0.3.0] - 2020-11-22
- fix setting frequency

----

## [0.2.3] - 2020-11-21
- fix digitalWrite (internal version only)

## [0.2.2] - 2020-09-21
- fix #1
- add getFrequency()

## [0.2.1] - 2020-06-19
- fix library.json

## [0.2.0] - 2020-05-25
- refactor; ESP32 begin(sda,scl)

----

## [0.1.1] - 2019-01-30
- testing && fixing

## [0.1.0] - 2021-12-02
- initial BETA version

54 changes: 16 additions & 38 deletions PCA9685.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,17 @@
// FILE: PCA9685.cpp
// AUTHOR: Rob Tillaart
// DATE: 24-apr-2016
// VERSION: 0.4.0
// VERSION: 0.4.1
// PURPOSE: Arduino library for I2C PCA9685 16 channel PWM
// URL: https://github.com/RobTillaart/PCA9685_RT
//
// HISTORY:
// 0.1.0 2016-04-24 initial BETA version
// 0.1.1 2019-01-30 testing && fixing

// 0.2.0 2020-05-25 refactor; ESP32 begin(sda,scl)
// 0.2.1 2020-06-19 fix library.json
// 0.2.2 2020-09-21 fix #1 + add getFrequency()
// 0.2.3 2020-11-21 fix digitalWrite (internal version only)

// 0.3.0 2020-11-22 fix setting frequency
// 0.3.1 2021-01-05 Arduino-CI + unit test
// 0.3.2 2021-01-14 WireN support
// 0.3.3 2021-12-23 update library.json, license, readme, minor edits
// 0.3.4 2022-01-03 add channelCount()

// 0.4.0 2022-06-09 breaking changes (sync with pca9634)
// rename reset() to configure()
// add mode1 and mode2 parameter to configure.
// add SUB CALL and ALL CALL functions.
// update documentation.
// renamed PCA9685_MODE2_STOP to PCA9685_MODE2_ACK
// add mode parameters to begin()


#include "PCA9685.h"



//////////////////////////////////////////////////////////////
//
// Constructor
// Constructor
//
PCA9685::PCA9685(const uint8_t deviceAddress, TwoWire *wire)
{
Expand Down Expand Up @@ -115,7 +91,7 @@ uint8_t PCA9685::readMode(uint8_t reg)
}


// write value to single PWM channel
// write value to single PWM channel
void PCA9685::setPWM(uint8_t channel, uint16_t onTime, uint16_t offTime)
{
_error = PCA9685_OK;
Expand All @@ -130,14 +106,14 @@ void PCA9685::setPWM(uint8_t channel, uint16_t onTime, uint16_t offTime)
}


// write value to single PWM channel
// write value to single PWM channel
void PCA9685::setPWM(uint8_t channel, uint16_t offTime)
{
setPWM(channel, 0, offTime);
}


// read value from single PWM channel
// read value from single PWM channel
void PCA9685::getPWM(uint8_t channel, uint16_t* onTime, uint16_t* offTime)
{
_error = PCA9685_OK;
Expand All @@ -162,17 +138,17 @@ void PCA9685::getPWM(uint8_t channel, uint16_t* onTime, uint16_t* offTime)
}


// set update frequency for all channels
// set update frequency for all channels
void PCA9685::setFrequency(uint16_t freq, int offset)
{
_error = PCA9685_OK;
_freq = freq;
// limits frequency see page 25 datasheet
if (_freq < PCA9685_MIN_FREQ) _freq = PCA9685_MIN_FREQ;
if (_freq > PCA9685_MAX_FREQ) _freq = PCA9685_MAX_FREQ;
// removed float operation for speed
// faster and equal accurate
// uint8_t scaler = round(25e6 / (_freq * 4096)) - 1;
// removed float operation for speed
// faster and equal accurate
// uint8_t scaler = round(25e6 / (_freq * 4096)) - 1;
uint8_t scaler = 48828 / (_freq * 8) - 1;

uint8_t mode1 = readMode(PCA9685_MODE1);
Expand All @@ -197,9 +173,9 @@ int PCA9685::getFrequency(bool cache)
}


// datasheet P.18 - fig. 9:
// Note: bit[11-0] ON should NOT equal timer OFF in ON mode
// in OFF mode it doesn't matter.
// datasheet P.18 - fig. 9:
// Note: bit[11-0] ON should NOT equal timer OFF in ON mode
// in OFF mode it doesn't matter.
void PCA9685::digitalWrite(uint8_t channel, uint8_t mode)
{
_error = PCA9685_OK;
Expand Down Expand Up @@ -231,7 +207,7 @@ int PCA9685::lastError()

/////////////////////////////////////////////////////
//
// SUB CALL - ALL CALL
// SUB CALL - ALL CALL
//
bool PCA9685::enableSubCall(uint8_t nr)
{
Expand Down Expand Up @@ -332,7 +308,7 @@ uint8_t PCA9685::getAllCallAddress()

//////////////////////////////////////////////////////////////
//
// PRIVATE
// PRIVATE
//
void PCA9685::writeReg(uint8_t reg, uint8_t value)
{
Expand Down Expand Up @@ -369,4 +345,6 @@ uint8_t PCA9685::readReg(uint8_t reg)
return _data;
}


// -- END OF FILE --

4 changes: 2 additions & 2 deletions PCA9685.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// FILE: PCA9685.h
// AUTHOR: Rob Tillaart
// DATE: 24-apr-2016
// VERSION: 0.4.0
// VERSION: 0.4.1
// PURPOSE: Arduino library for I2C PCA9685 16 channel PWM
// URL: https://github.com/RobTillaart/PCA9685_RT

Expand All @@ -12,7 +12,7 @@
#include "Wire.h"


#define PCA9685_LIB_VERSION (F("0.4.0"))
#define PCA9685_LIB_VERSION (F("0.4.1"))

// ERROR CODES
#define PCA9685_OK 0x00
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,13 @@ See examples

## Future

#### must
- improve documentation

#### should
- add unit tests (if possible)

#### could
- investigate int vs uint16_t ?
- **setFrequency(), getFrequency(), \_freq**
- sync with PCA9634/35/85 where possible
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/PCA9685_RT.git"
},
"version": "0.4.0",
"version": "0.4.1",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=PCA9685_RT
version=0.4.0
version=0.4.1
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for I2C PCA9685 16 channel PWM
Expand Down

0 comments on commit 234e73e

Please sign in to comment.