From 234e73e3e94de68ada7224dae460e0fa664d9bac Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Sat, 19 Nov 2022 16:55:33 +0100 Subject: [PATCH] add changelog.md (#17) --- .arduino-ci.yml | 19 +++++++++++++- CHANGELOG.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++ PCA9685.cpp | 54 ++++++++++++-------------------------- PCA9685.h | 4 +-- README.md | 5 ++++ library.json | 2 +- library.properties | 2 +- 7 files changed, 107 insertions(+), 43 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.arduino-ci.yml b/.arduino-ci.yml index e7cb463..10c0e10 100644 --- a/.arduino-ci.yml +++ b/.arduino-ci.yml @@ -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: @@ -8,4 +23,6 @@ compile: - m4 - esp32 # - esp8266 - # - mega2560 \ No newline at end of file + # - mega2560 + - rpipico + diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1dcb42b --- /dev/null +++ b/CHANGELOG.md @@ -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 + diff --git a/PCA9685.cpp b/PCA9685.cpp index e949949..5f02e52 100644 --- a/PCA9685.cpp +++ b/PCA9685.cpp @@ -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) { @@ -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; @@ -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; @@ -162,7 +138,7 @@ 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; @@ -170,9 +146,9 @@ void PCA9685::setFrequency(uint16_t freq, int offset) // 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); @@ -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; @@ -231,7 +207,7 @@ int PCA9685::lastError() ///////////////////////////////////////////////////// // -// SUB CALL - ALL CALL +// SUB CALL - ALL CALL // bool PCA9685::enableSubCall(uint8_t nr) { @@ -332,7 +308,7 @@ uint8_t PCA9685::getAllCallAddress() ////////////////////////////////////////////////////////////// // -// PRIVATE +// PRIVATE // void PCA9685::writeReg(uint8_t reg, uint8_t value) { @@ -369,4 +345,6 @@ uint8_t PCA9685::readReg(uint8_t reg) return _data; } + // -- END OF FILE -- + diff --git a/PCA9685.h b/PCA9685.h index 39df1db..dc9c347 100644 --- a/PCA9685.h +++ b/PCA9685.h @@ -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 @@ -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 diff --git a/README.md b/README.md index 91727a6..e5ee129 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/library.json b/library.json index 63b7e00..883d22d 100644 --- a/library.json +++ b/library.json @@ -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": "*", diff --git a/library.properties b/library.properties index 19d1018..5972700 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=PCA9685_RT -version=0.4.0 +version=0.4.1 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for I2C PCA9685 16 channel PWM