From 3621777c7f450ddb363960e163116018dc7251a5 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Wed, 14 Aug 2024 16:20:38 +0200 Subject: [PATCH] 0.3.0 HC4051 --- libraries/HC4051/CHANGELOG.md | 6 ++++++ libraries/HC4051/HC4051.h | 7 ++++--- libraries/HC4051/README.md | 8 ++++++-- libraries/HC4051/library.json | 2 +- libraries/HC4051/library.properties | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/libraries/HC4051/CHANGELOG.md b/libraries/HC4051/CHANGELOG.md index c597b1ad..7a99c304 100644 --- a/libraries/HC4051/CHANGELOG.md +++ b/libraries/HC4051/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.3.0] - 2024-08-14 +- Fix for setChannel(), Thanks to C. Fraser! +- update readme.md + +---- + ## [0.2.1] - 2024-05-28 - change return type of **bool setChannel()** - verify the channel parameter of **bool setChannel()** diff --git a/libraries/HC4051/HC4051.h b/libraries/HC4051/HC4051.h index 14ab18c6..95db7408 100644 --- a/libraries/HC4051/HC4051.h +++ b/libraries/HC4051/HC4051.h @@ -3,7 +3,7 @@ // FILE: HC4051.h // AUTHOR: Rob Tillaart // DATE: 2023-01-25 -// VERSION: 0.2.1 +// VERSION: 0.3.0 // PURPOSE: Arduino library for CD74HC4051 1 x 8 channel multiplexer and compatibles. // URL: https://github.com/RobTillaart/HC4051 @@ -11,7 +11,7 @@ #include "Arduino.h" -#define HC4051_LIB_VERSION (F("0.2.1")) +#define HC4051_LIB_VERSION (F("0.3.0")) class HC4051 @@ -57,8 +57,9 @@ public: // only write changed pins. // AVR only? if (mask & _changed) { - digitalWrite(_pins[i--], (mask & _new)); + digitalWrite(_pins[i], (mask & _new)); } + i--; mask >>= 1; } enable(); diff --git a/libraries/HC4051/README.md b/libraries/HC4051/README.md index 220cb7a5..26adf378 100644 --- a/libraries/HC4051/README.md +++ b/libraries/HC4051/README.md @@ -31,6 +31,10 @@ The channel selection is done with four select lines **A, B, C** The device can be enabled/disabled by the enable line **INH** +### 0.3.0 breaking change + +Version 0.3.0 has a bugfix for **setChannel()** which obsolete all previous versions. + #### Compatibles @@ -99,7 +103,7 @@ This will result in another subset of the Y pins to select from. #include "HC4051.h" ``` -#### Core +### Core - **HC4051(uint8_t A, uint8_t B, uint8_t C, uint8_t enablePin = 255)** constructor. Set the three select pins and optional the enable pin. @@ -118,7 +122,7 @@ Note the device cannot be disabled if there is no enable pin configured. The selected channel is also returned when the multiplexer is disabled. -#### Enable +### Enable These functions work only if a valid **enablePin** is set in the constructor. diff --git a/libraries/HC4051/library.json b/libraries/HC4051/library.json index 2903728e..75c41c1e 100644 --- a/libraries/HC4051/library.json +++ b/libraries/HC4051/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/HC4051.git" }, - "version": "0.2.1", + "version": "0.3.0", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/libraries/HC4051/library.properties b/libraries/HC4051/library.properties index 945d04dc..d15c623b 100644 --- a/libraries/HC4051/library.properties +++ b/libraries/HC4051/library.properties @@ -1,5 +1,5 @@ name=HC4051 -version=0.2.1 +version=0.3.0 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for a HC4051 1x8 channel multiplexer