From c3bb5e50e1ce7237526f4f53482a2dd6b77d3d84 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Mon, 16 Oct 2023 16:13:58 +0200 Subject: [PATCH] 0.1.1 ADG731 --- libraries/ADG731/ADG731.h | 6 +++--- libraries/ADG731/CHANGELOG.md | 5 +++++ libraries/ADG731/README.md | 19 +++++++++++++++---- .../examples/ADG731_demo/ADG731_demo.ino | 7 +++++-- libraries/ADG731/keywords.txt | 2 +- libraries/ADG731/library.json | 2 +- libraries/ADG731/library.properties | 2 +- 7 files changed, 31 insertions(+), 12 deletions(-) diff --git a/libraries/ADG731/ADG731.h b/libraries/ADG731/ADG731.h index 1c6705ff..2b93b7a6 100644 --- a/libraries/ADG731/ADG731.h +++ b/libraries/ADG731/ADG731.h @@ -3,14 +3,14 @@ // FILE: ADG731.h // AUTHOR: Rob Tillaart // DATE: 2023-07-24 -// VERSION: 0.1.0 +// VERSION: 0.1.1 // PURPOSE: Arduino library for ADG731 - 32 to 1 channel multiplexer // URL: https://github.com/RobTillaart/ADG731 #include "Arduino.h" -#define ADG731_LIB_VERSION (F("0.1.0")) +#define ADG731_LIB_VERSION (F("0.1.1")) #define ADG731_ALLOFF 0x80 @@ -39,7 +39,7 @@ public: void setChannel(uint8_t channel) { - _channel = channel & 0x0F; + _channel = channel & 0x1F; write(_channel); } diff --git a/libraries/ADG731/CHANGELOG.md b/libraries/ADG731/CHANGELOG.md index 522aed1c..a2f91a95 100644 --- a/libraries/ADG731/CHANGELOG.md +++ b/libraries/ADG731/CHANGELOG.md @@ -6,5 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.1.1] - 2023-10-16 +- update readme.md (badges) +- fix setChannel() - mask. + + ## [0.1.0] - 2023-07-24 - initial version diff --git a/libraries/ADG731/README.md b/libraries/ADG731/README.md index 568d2c8a..6812e834 100644 --- a/libraries/ADG731/README.md +++ b/libraries/ADG731/README.md @@ -2,8 +2,11 @@ [![Arduino CI](https://github.com/RobTillaart/ADG731/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) [![Arduino-lint](https://github.com/RobTillaart/ADG731/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/ADG731/actions/workflows/arduino-lint.yml) [![JSON check](https://github.com/RobTillaart/ADG731/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/ADG731/actions/workflows/jsoncheck.yml) +[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/ADG731.svg)](https://github.com/RobTillaart/ADG731/issues) + [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/ADG731/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/RobTillaart/ADG731.svg?maxAge=3600)](https://github.com/RobTillaart/ADG731/releases) +[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/ADG731.svg)](https://registry.platformio.org/libraries/robtillaart/ADG731) # ADG731 @@ -31,9 +34,6 @@ Not tests with hardware have been done yet, so use with care. Feedback welcome! -TODO insert picture. - - #### Related - https://github.com/RobTillaart/HC4051 (1x8 mux) @@ -41,7 +41,9 @@ TODO insert picture. - https://github.com/RobTillaart/HC4053 (3x2 mux) - https://github.com/RobTillaart/HC4067 (1x16 mux) - https://github.com/RobTillaart/ADG725 (2x16 mux) +- https://github.com/RobTillaart/ADG726 (2x16 mux) - https://github.com/RobTillaart/ADG731 (1x32 mux) +- https://github.com/RobTillaart/ADG732 (1x32 mux) ## Interface @@ -55,7 +57,7 @@ TODO insert picture. Valid values for channel are 0..31. - **uint8_t getChannel()** get last set channel == 0..31 or ADG731_ALLOFF. - **uint8_t channelCount()** returns 32 for ADG731. - +- **void allOff()** sets all channels to OFF, none selected. ## Future @@ -75,3 +77,12 @@ Valid values for channel are 0..31. #### Wont +## Support + +If you appreciate my libraries, you can support the development and maintenance. +Improve the quality of the libraries by providing issues and Pull Requests, or +donate through PayPal or GitHub sponsors. + +Thank you, + + diff --git a/libraries/ADG731/examples/ADG731_demo/ADG731_demo.ino b/libraries/ADG731/examples/ADG731_demo/ADG731_demo.ino index 204a23ea..6732cda8 100644 --- a/libraries/ADG731/examples/ADG731_demo/ADG731_demo.ino +++ b/libraries/ADG731/examples/ADG731_demo/ADG731_demo.ino @@ -20,10 +20,13 @@ void setup() delay(100); start = micros(); - ADG.setChannel(0); + for (int ch = 0; ch < 32; ch++) + { + ADG.setChannel(ch); + } stop = micros(); Serial.print("Time:\t"); - Serial.println(stop - start); + Serial.println((stop - start) / 32.0); delay(100); start = micros(); diff --git a/libraries/ADG731/keywords.txt b/libraries/ADG731/keywords.txt index 1ca6222f..c52afcd3 100644 --- a/libraries/ADG731/keywords.txt +++ b/libraries/ADG731/keywords.txt @@ -6,9 +6,9 @@ ADG731 KEYWORD1 # Methods and Functions (KEYWORD2) setChannel KEYWORD2 -setChannel KEYWORD2 getChannel KEYWORD2 channelCount KEYWORD2 +allOff KEYWORD2 # Constants (LITERAL1) diff --git a/libraries/ADG731/library.json b/libraries/ADG731/library.json index cacd4823..dde04782 100644 --- a/libraries/ADG731/library.json +++ b/libraries/ADG731/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/ADG731" }, - "version": "0.1.0", + "version": "0.1.1", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/libraries/ADG731/library.properties b/libraries/ADG731/library.properties index 2bb54416..60671842 100644 --- a/libraries/ADG731/library.properties +++ b/libraries/ADG731/library.properties @@ -1,5 +1,5 @@ name=ADG731 -version=0.1.0 +version=0.1.1 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for ADG731 - 32 to 1 channel multiplexer.