diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 90d9ab4..554358c 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,4 @@ # These are supported funding model platforms github: RobTillaart - +custom: "https://www.paypal.me/robtillaart" diff --git a/.github/workflows/arduino-lint.yml b/.github/workflows/arduino-lint.yml index 8a26f14..870a176 100644 --- a/.github/workflows/arduino-lint.yml +++ b/.github/workflows/arduino-lint.yml @@ -6,7 +6,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: arduino/arduino-lint-action@v1 with: library-manager: update diff --git a/.github/workflows/arduino_test_runner.yml b/.github/workflows/arduino_test_runner.yml index a1090a6..457d51a 100644 --- a/.github/workflows/arduino_test_runner.yml +++ b/.github/workflows/arduino_test_runner.yml @@ -6,9 +6,10 @@ on: [push, pull_request] jobs: runTest: runs-on: ubuntu-latest + timeout-minutes: 20 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.6 diff --git a/.github/workflows/jsoncheck.yml b/.github/workflows/jsoncheck.yml index 37a1129..d4f78d5 100644 --- a/.github/workflows/jsoncheck.yml +++ b/.github/workflows/jsoncheck.yml @@ -10,9 +10,9 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: json-syntax-check - uses: limitusus/json-syntax-check@v1 + uses: limitusus/json-syntax-check@v2 with: pattern: "\\.json$" diff --git a/ADG725.h b/ADG725.h index cc90c9b..b460853 100644 --- a/ADG725.h +++ b/ADG725.h @@ -3,14 +3,14 @@ // FILE: ADG725.h // AUTHOR: Rob Tillaart // DATE: 2023-07-24 -// VERSION: 0.1.1 +// VERSION: 0.1.2 // PURPOSE: Arduino library for ADG725 - 16 to 1 channel (2x) multiplexer // URL: https://github.com/RobTillaart/ADG725 #include "Arduino.h" -#define ADG725_LIB_VERSION (F("0.1.1")) +#define ADG725_LIB_VERSION (F("0.1.2")) #define ADG725_ALLOFF 0x80 // ENable bit (false) #define ADG725_A_ONLY 0x20 // retain B @@ -68,8 +68,8 @@ class ADG725 { return _channelA; } - - + + uint8_t getChannelB() { return _channelB; @@ -93,14 +93,17 @@ class ADG725 private: void write(uint8_t data) { + uint8_t cl = _clockPin; + uint8_t da = _dataPin; digitalWrite(_syncPin, LOW); for (int i = 0; i < 8; i++) { // CLOCK max 30 MHz. - digitalWrite(_clockPin, HIGH); - digitalWrite(_dataPin, (data & 0x80) > 0); + digitalWrite(cl, HIGH); + // MSB first + digitalWrite(da, (data & 0x80) > 0); data <<= 1; - digitalWrite(_clockPin, LOW); + digitalWrite(cl, LOW); } digitalWrite(_syncPin, HIGH); } diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c4720d..5b1e3d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.1.2] - 2024-03-17 +- update GitHub actions +- add performance example +- minor performance tweak. + + ## [0.1.1] - 2023-10-16 - update readme.md - ## [0.1.0] - 2023-07-24 - initial version diff --git a/LICENSE b/LICENSE index 16ef155..0305337 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023-2023 Rob Tillaart +Copyright (c) 2023-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/README.md b/README.md index 5e5317c..c9f8650 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,6 @@ Valid values for channel are 0..15. #### Should - add examples -- check performance #### Could diff --git a/examples/ADG725_demo/ADG725_demo.ino b/examples/ADG725_demo/ADG725_demo.ino index 0fac5a8..12bb80f 100644 --- a/examples/ADG725_demo/ADG725_demo.ino +++ b/examples/ADG725_demo/ADG725_demo.ino @@ -12,13 +12,14 @@ ADG725 ADG(10, 11, 12); uint32_t start, stop; + void setup() { Serial.begin(115200); Serial.print("ADG725_LIB_VERSION: "); Serial.println(ADG725_LIB_VERSION); delay(100); - + start = micros(); for (int ch = 0; ch < 16; ch++) { diff --git a/examples/ADG725_performance/ADG725_performance.ino b/examples/ADG725_performance/ADG725_performance.ino new file mode 100644 index 0000000..8dc3e03 --- /dev/null +++ b/examples/ADG725_performance/ADG725_performance.ino @@ -0,0 +1,60 @@ +r// +// FILE: ADG725_performance.ino +// AUTHOR: Rob Tillaart +// PURPOSE: measure performance +// URL: https://github.com/RobTillaart/ADG725 + + +#include "ADG725.h" + + +ADG725 ADG(10, 11, 12); + +uint32_t start, stop; + + +void setup() +{ + Serial.begin(115200); + Serial.print("ADG725_LIB_VERSION: "); + Serial.println(ADG725_LIB_VERSION); + delay(100); + + start = micros(); + for (int ch = 0; ch < 16; ch++) + { + ADG.setChannel(ch); + } + stop = micros(); + Serial.print("setChannel:\t"); + Serial.println((stop - start) / 16.0); + delay(100); + + start = micros(); + for (int ch = 0; ch < 16; ch++) + { + ADG.setChannelA(ch); + } + stop = micros(); + Serial.print("setChannelA:\t"); + Serial.println((stop - start) / 16.0); + delay(100); + + start = micros(); + for (int ch = 0; ch < 16; ch++) + { + ADG.setChannelB(ch); + } + stop = micros(); + Serial.print("setChannelB:\t"); + Serial.println((stop - start) / 16.0); + delay(100); +} + + +void loop() +{ +} + + +// -- END OF FILE -- diff --git a/examples/ADG725_performance/performance_0.1.1.txt b/examples/ADG725_performance/performance_0.1.1.txt new file mode 100644 index 0000000..470a7a7 --- /dev/null +++ b/examples/ADG725_performance/performance_0.1.1.txt @@ -0,0 +1,7 @@ +Arduino UNO +IDE:1.8.19 + +ADG725_LIB_VERSION: 0.1.1 +setChannel: 125.25 +setChannelA: 125.00 +setChannelB: 125.25 diff --git a/examples/ADG725_performance/performance_0.1.2.txt b/examples/ADG725_performance/performance_0.1.2.txt new file mode 100644 index 0000000..2a2fe32 --- /dev/null +++ b/examples/ADG725_performance/performance_0.1.2.txt @@ -0,0 +1,8 @@ +Arduino UNO +IDE:1.8.19 + +ADG725_LIB_VERSION: 0.1.2 +setChannel: 124.50 +setChannelA: 124.25 +setChannelB: 124.25 + diff --git a/library.json b/library.json index ce682b0..68964e3 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/ADG725" }, - "version": "0.1.1", + "version": "0.1.2", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/library.properties b/library.properties index 2d191b5..d0bd233 100644 --- a/library.properties +++ b/library.properties @@ -1,9 +1,9 @@ name=ADG725 -version=0.1.1 +version=0.1.2 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for ADG725 - 16 to 1 channel (2x) multiplexer. -paragraph= +paragraph= category=Signal Input/Output url=https://github.com/RobTillaart/ADG725 architectures=*