From cb0cd503e1575e01dcf24df5abb8f81420df3420 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Thu, 18 Jan 2024 10:55:55 +0100 Subject: [PATCH] fix #32, setLedDriverMode(uint8_t mode) --- CHANGELOG.md | 8 +++++++- LICENSE | 2 +- PCA9635.cpp | 4 ++-- PCA9635.h | 6 ++---- README.md | 3 ++- .../PCA9635_OE_control/PCA9635_OE_control.ino | 4 +--- .../PCA9635_performance.ino | 18 ++++++++---------- .../PCA9635_shift_rotate.ino | 4 +--- examples/PCA9635_test01/PCA9635_test01.ino | 4 +--- .../PCA9635_test_multiple.ino | 4 +--- library.json | 2 +- library.properties | 2 +- 12 files changed, 28 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index acb29d3..b83b151 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.6.0] - 2024-01-18 +- fix #32, setLedDriverMode(uint8_t mode) +- minor edits (examples) + +---- + ## [0.5.0] - 2023-12-11 -= refactor API, begin() +- refactor API, begin() - add **uint8_t getAddress()** - update readme.md - update examples diff --git a/LICENSE b/LICENSE index eae2a1a..cef01c5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016-2023 Rob Tillaart +Copyright (c) 2016-2024 Rob Tillaart Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/PCA9635.cpp b/PCA9635.cpp index 9924c76..a6cdc57 100644 --- a/PCA9635.cpp +++ b/PCA9635.cpp @@ -2,7 +2,7 @@ // FILE: PCA9635.cpp // AUTHOR: Rob Tillaart // DATE: 23-apr-2016 -// VERSION: 0.5.0 +// VERSION: 0.6.0 // PURPOSE: Arduino library for PCA9635 I2C LED driver, 16 channel PWM, 8 bit // URL: https://github.com/RobTillaart/PCA9635 @@ -517,7 +517,7 @@ uint8_t PCA9635::setLedDriverMode(uint8_t mode) mask = 0b00000000; break; } - for (int reg = 0; reg < 3; reg++) + for (int reg = 0; reg < 4; reg++) { writeLedOut(reg, mask); } diff --git a/PCA9635.h b/PCA9635.h index 08dbbed..ca2c503 100644 --- a/PCA9635.h +++ b/PCA9635.h @@ -3,7 +3,7 @@ // FILE: PCA9635.h // AUTHOR: Rob Tillaart // DATE: 23-apr-2016 -// VERSION: 0.5.0 +// VERSION: 0.6.0 // PURPOSE: Arduino library for PCA9635 I2C LED driver, 16 channel PWM, 8 bit // URL: https://github.com/RobTillaart/PCA9635 @@ -12,7 +12,7 @@ #include "Wire.h" -#define PCA9635_LIB_VERSION (F("0.5.0")) +#define PCA9635_LIB_VERSION (F("0.6.0")) // mode codes @@ -107,8 +107,6 @@ #define PCA9635_MODE2_NONE 0x00 -// NOT IMPLEMENTED YET (TODO check) -// // Registers in which the ALLCALL and sub-addresses are stored // NEW #define PCA963X_SUBADR(x) (0x17 +(x)) // x = 1..3 diff --git a/README.md b/README.md index 1d7fc15..36784a0 100644 --- a/README.md +++ b/README.md @@ -316,7 +316,8 @@ PCA.writeLedOut(1, mask); - return values etc. - documentation. - keep in sync with PCA9634/5 developments - +- remove OLD #defines PCA9635_... => PCA963X + - const int? #### Could diff --git a/examples/PCA9635_OE_control/PCA9635_OE_control.ino b/examples/PCA9635_OE_control/PCA9635_OE_control.ino index 4f26579..7571696 100644 --- a/examples/PCA9635_OE_control/PCA9635_OE_control.ino +++ b/examples/PCA9635_OE_control/PCA9635_OE_control.ino @@ -5,8 +5,6 @@ // URL: https://github.com/RobTillaart/PCA9635 -#include "Arduino.h" -#include "Wire.h" #include "PCA9635.h" @@ -17,7 +15,7 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); - Serial.print("PCA9635 LIB version: "); + Serial.print("PCA9635_LIB_VERSION: "); Serial.println(PCA9635_LIB_VERSION); Serial.println(); diff --git a/examples/PCA9635_performance/PCA9635_performance.ino b/examples/PCA9635_performance/PCA9635_performance.ino index 132c772..6f5486d 100644 --- a/examples/PCA9635_performance/PCA9635_performance.ino +++ b/examples/PCA9635_performance/PCA9635_performance.ino @@ -5,8 +5,6 @@ // URL: https://github.com/RobTillaart/PCA9635 -#include "Arduino.h" -#include "Wire.h" #include "PCA9635.h" @@ -18,7 +16,7 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); - Serial.print("PCA9635 LIB version: "); + Serial.print("PCA9635_LIB_VERSION: "); Serial.println(PCA9635_LIB_VERSION); Serial.println(); @@ -26,25 +24,25 @@ void setup() ledArray.begin(); - delay(100); // flush all Serial interrupts + delay(100); // flush Serial buffer / interrupts start = micros(); - ledArray.write1(0, 127); // 50% + ledArray.write1(0, 127); // PWM at ~50% stop = micros(); Serial.print("ONE:\t"); Serial.println(stop - start); - delay(100); // flush all Serial interrupts + delay(100); // flush Serial buffer / interrupts start = micros(); - ledArray.write1(0, 127); // ~50% - ledArray.write1(1, 128); // ~50% + ledArray.write1(0, 127); // PWM at ~50% + ledArray.write1(1, 128); // PWM at ~50% stop = micros(); Serial.print("TWO:\t"); Serial.println(stop - start); - delay(100); // flush all Serial interrupts + delay(100); // flush Serial buffer / interrupts uint8_t n = 123; start = micros(); - ledArray.writeN(0, &n, 1); // ~50% + ledArray.writeN(0, &n, 1); // PWM at ~50% stop = micros(); Serial.print("wrN:\t"); Serial.println(stop - start); diff --git a/examples/PCA9635_shift_rotate/PCA9635_shift_rotate.ino b/examples/PCA9635_shift_rotate/PCA9635_shift_rotate.ino index be31a1b..d50cb15 100644 --- a/examples/PCA9635_shift_rotate/PCA9635_shift_rotate.ino +++ b/examples/PCA9635_shift_rotate/PCA9635_shift_rotate.ino @@ -5,8 +5,6 @@ // URL: https://github.com/RobTillaart/PCA9635 -#include "Arduino.h" -#include "Wire.h" #include "PCA9635.h" @@ -21,7 +19,7 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); - Serial.print("PCA9635 LIB version: "); + Serial.print("PCA9635_LIB_VERSION: "); Serial.println(PCA9635_LIB_VERSION); Serial.println(); diff --git a/examples/PCA9635_test01/PCA9635_test01.ino b/examples/PCA9635_test01/PCA9635_test01.ino index f2ea29a..2f2bf35 100644 --- a/examples/PCA9635_test01/PCA9635_test01.ino +++ b/examples/PCA9635_test01/PCA9635_test01.ino @@ -5,8 +5,6 @@ // URL: https://github.com/RobTillaart/PCA9635 -#include "Arduino.h" -#include "Wire.h" #include "PCA9635.h" @@ -17,7 +15,7 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); - Serial.print("PCA9635 LIB version: "); + Serial.print("PCA9635_LIB_VERSION: "); Serial.println(PCA9635_LIB_VERSION); Serial.println(); diff --git a/examples/PCA9635_test_multiple/PCA9635_test_multiple.ino b/examples/PCA9635_test_multiple/PCA9635_test_multiple.ino index 8ee70c9..4e777a1 100644 --- a/examples/PCA9635_test_multiple/PCA9635_test_multiple.ino +++ b/examples/PCA9635_test_multiple/PCA9635_test_multiple.ino @@ -5,8 +5,6 @@ // URL: https://github.com/RobTillaart/PCA9635 -#include "Arduino.h" -#include "Wire.h" #include "PCA9635.h" @@ -18,7 +16,7 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); - Serial.print("PCA9635 LIB version: "); + Serial.print("PCA9635_LIB_VERSION: "); Serial.println(PCA9635_LIB_VERSION); Serial.println(); diff --git a/library.json b/library.json index aba87dd..3326378 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/PCA9635.git" }, - "version": "0.5.0", + "version": "0.6.0", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/library.properties b/library.properties index 0b99bf2..78e6a44 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=PCA9635 -version=0.5.0 +version=0.6.0 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for PCA9635 I2C LED driver, 16 channel PWM, 8 bit.