diff --git a/libraries/AS5600/.github/FUNDING.yml b/libraries/AS5600/.github/FUNDING.yml index 90d9ab4c..2859c159 100644 --- a/libraries/AS5600/.github/FUNDING.yml +++ b/libraries/AS5600/.github/FUNDING.yml @@ -1,4 +1,5 @@ # These are supported funding model platforms -github: RobTillaart +github: RobTillaart +custom: "https://www.paypal.me/robtillaart" diff --git a/libraries/AS5600/.github/workflows/arduino-lint.yml b/libraries/AS5600/.github/workflows/arduino-lint.yml index 8a26f14a..70d8d1c3 100644 --- a/libraries/AS5600/.github/workflows/arduino-lint.yml +++ b/libraries/AS5600/.github/workflows/arduino-lint.yml @@ -5,8 +5,9 @@ on: [push, pull_request] jobs: lint: runs-on: ubuntu-latest + timeout-minutes: 5 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: arduino/arduino-lint-action@v1 with: library-manager: update diff --git a/libraries/AS5600/.github/workflows/arduino_test_runner.yml b/libraries/AS5600/.github/workflows/arduino_test_runner.yml index fadfa904..be74547e 100644 --- a/libraries/AS5600/.github/workflows/arduino_test_runner.yml +++ b/libraries/AS5600/.github/workflows/arduino_test_runner.yml @@ -6,12 +6,14 @@ 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 - run: | + # sudo sysctl vm.mmap_rnd_bits=28 gem install arduino_ci arduino_ci.rb diff --git a/libraries/AS5600/.github/workflows/jsoncheck.yml b/libraries/AS5600/.github/workflows/jsoncheck.yml index 37a11298..fd05f5f8 100644 --- a/libraries/AS5600/.github/workflows/jsoncheck.yml +++ b/libraries/AS5600/.github/workflows/jsoncheck.yml @@ -9,10 +9,11 @@ on: jobs: test: runs-on: ubuntu-latest + timeout-minutes: 5 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/libraries/AS5600/AS5600.cpp b/libraries/AS5600/AS5600.cpp index ad9f86d7..23ddbb07 100644 --- a/libraries/AS5600/AS5600.cpp +++ b/libraries/AS5600/AS5600.cpp @@ -1,7 +1,7 @@ // // FILE: AS56000.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.6.0 +// VERSION: 0.6.1 // PURPOSE: Arduino library for AS5600 magnetic rotation meter // DATE: 2022-05-28 // URL: https://github.com/RobTillaart/AS5600 @@ -463,6 +463,7 @@ float AS5600::getAngularSpeed(uint8_t mode) int32_t AS5600::getCumulativePosition() { int16_t value = readReg2(AS5600_ANGLE) & 0x0FFF; + if (_error != AS5600_OK) return _position; // whole rotation CW? // less than half a circle diff --git a/libraries/AS5600/AS5600.h b/libraries/AS5600/AS5600.h index f0323eef..d0941a15 100644 --- a/libraries/AS5600/AS5600.h +++ b/libraries/AS5600/AS5600.h @@ -2,7 +2,7 @@ // // FILE: AS5600.h // AUTHOR: Rob Tillaart -// VERSION: 0.6.0 +// VERSION: 0.6.1 // PURPOSE: Arduino library for AS5600 magnetic rotation meter // DATE: 2022-05-28 // URL: https://github.com/RobTillaart/AS5600 @@ -12,7 +12,7 @@ #include "Wire.h" -#define AS5600_LIB_VERSION (F("0.6.0")) +#define AS5600_LIB_VERSION (F("0.6.1")) // default addresses diff --git a/libraries/AS5600/CHANGELOG.md b/libraries/AS5600/CHANGELOG.md index c92a7a57..352901d8 100644 --- a/libraries/AS5600/CHANGELOG.md +++ b/libraries/AS5600/CHANGELOG.md @@ -5,6 +5,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.6.1] - 2024-03-31 +- improve **getCumulativePosition()**, catch I2C error, see #62 +- update readme.md (incl reorder future work). +- update GitHub actions +- minor edits + + ## [0.6.0] - 2024-01-25 - add experimental error handling - add **int lastError()** so user can check the status of last I2C actions. diff --git a/libraries/AS5600/README.md b/libraries/AS5600/README.md index 3c0f744c..42bcbe20 100644 --- a/libraries/AS5600/README.md +++ b/libraries/AS5600/README.md @@ -20,9 +20,9 @@ Arduino library for AS5600 and AS5600L magnetic rotation meter. **AS5600** is a library for an AS5600 / AS5600L based magnetic **rotation** meter. More exact, it measures the angle (rotation w.r.t. reference) and not RPM. -Multiple angle measurements allows one to calculate / estimate the RPM. +Multiple angle measurements allows one to calculate or estimate the RPM. -The AS5600 and AS5600L sensors are pin compatible (always check datasheet). +The AS5600 and AS5600L sensors are pin compatible (always check your model's datasheet). **Warning: experimental** @@ -39,10 +39,10 @@ Please share your experiences. #### 0.5.0 Breaking change Version 0.5.0 introduced a breaking change. -You cannot set the pins in **begin()** any more. +You cannot set the SDA and SCL pins in **begin()** any more. This reduces the dependency of processor dependent Wire implementations. -The user has to call **Wire.begin()** and can optionally set the Wire pins -before calling **begin()**. +The user has to call **Wire.begin()** and can optionally set the I2C pins +before calling **AS5600.begin()**. #### Related libraries @@ -64,6 +64,7 @@ Do not forget to add the pull up resistors to improve the I2C signals. The AS5600 datasheet states it supports Fast-Mode == 400 KHz and Fast-Mode-Plus == 1000 KHz. + #### Pull ups I2C performance tests with an AS5600L with an UNO failed at 400 KHz. @@ -128,7 +129,7 @@ This resistor needs to be removed to use the **OUT** pin. Not tested. ==> Read the datasheet! -PGO stands for Programming Option, it is used to calibrate / program the sensor. +PGO stands for ProGramming Option, it is used to calibrate and program the sensor. As the sensor can be programmed only a few times one should use this functionality with extreme care. See datasheet for a detailed list of steps to be done. @@ -731,38 +732,37 @@ priority is relative. #### Should +- implement extended error handling in public functions. + - will increase footprint !! how much? + - **call writeReg() only if readReg() is OK** ==> prevent incorrect writes + - ```if (_error != 0) return false;``` + - idem readReg2() + - set AS5600_ERROR_PARAMETER e.g. setZPosition() + - a derived class with extended error handling? - investigate **readMagnitude()** - combination of AGC and MD, ML and MH flags? -- investigate OUT behaviour in practice +- investigate **OUT** behaviour in practice - analogue - PWM - need AS5600 on breakout with support -- write examples: - - as5600_calibration.ino (needs HW and lots of time) - - different configuration options - check / verify Power-up time - 1 minute (need HW) - check Timing Characteristics (datasheet) - is there improvement possible. - #### Could -- investigate PGO programming pin. +- investigate **PGO** programming pin. - check for compatible devices - AS5200 ? - investigate performance - basic performance per function - I2C improvements - software direction -- implement extended error handling in public functions. - - will increase footprint !! how much? - - writeReg() only if readReg() is OK ==> prevent incorrect writes - - ```if (_error != 0) return false;``` - - set AS5600_ERROR_PARAMETER e.g. setZPosition() - - a derived class with extended error handling? - +- write examples: + - as5600_calibration.ino (needs HW and lots of time) + - different configuration options #### Wont (unless) diff --git a/libraries/AS5600/examples/AS5600_burn_conf_mang/AS5600_burn_conf_mang.ino b/libraries/AS5600/examples/AS5600_burn_conf_mang/AS5600_burn_conf_mang.ino index f58f3bb6..551e18d3 100644 --- a/libraries/AS5600/examples/AS5600_burn_conf_mang/AS5600_burn_conf_mang.ino +++ b/libraries/AS5600/examples/AS5600_burn_conf_mang/AS5600_burn_conf_mang.ino @@ -88,7 +88,7 @@ void burn_mang() const uint16_t FASTFILTER = 0; const uint16_t WATCHDOG = 0; const uint16_t MAXANGLE = 0; - + bool OK = true; OK = OK && as5600.setPowerMode(POWERMODE); OK = OK && (POWERMODE == as5600.getPowerMode()); diff --git a/libraries/AS5600/examples/AS5600_demo/AS5600_demo.ino b/libraries/AS5600/examples/AS5600_demo/AS5600_demo.ino index c0803481..0bcd9ae7 100644 --- a/libraries/AS5600/examples/AS5600_demo/AS5600_demo.ino +++ b/libraries/AS5600/examples/AS5600_demo/AS5600_demo.ino @@ -21,7 +21,7 @@ void setup() Serial.println(__FILE__); Serial.print("AS5600_LIB_VERSION: "); Serial.println(AS5600_LIB_VERSION); - + Wire.begin(); as5600.begin(4); // set direction pin. diff --git a/libraries/AS5600/examples/AS5600_demo_ESP32/AS5600_demo_ESP32.ino b/libraries/AS5600/examples/AS5600_demo_ESP32/AS5600_demo_ESP32.ino index 25b65ada..7e547113 100644 --- a/libraries/AS5600/examples/AS5600_demo_ESP32/AS5600_demo_ESP32.ino +++ b/libraries/AS5600/examples/AS5600_demo_ESP32/AS5600_demo_ESP32.ino @@ -23,7 +23,7 @@ void setup() Serial.println(AS5600_LIB_VERSION); Wire.begin(14, 15); - + as5600.begin(4); // set direction pin. as5600.setDirection(AS5600_CLOCK_WISE); // default, just be explicit. int b = as5600.isConnected(); diff --git a/libraries/AS5600/examples/AS5600_demo_software_direction/AS5600_demo_software_direction.ino b/libraries/AS5600/examples/AS5600_demo_software_direction/AS5600_demo_software_direction.ino index e6d23416..c0285ab7 100644 --- a/libraries/AS5600/examples/AS5600_demo_software_direction/AS5600_demo_software_direction.ino +++ b/libraries/AS5600/examples/AS5600_demo_software_direction/AS5600_demo_software_direction.ino @@ -27,7 +27,7 @@ void setup() Wire.begin(); - as5600.begin(); // set software direction control. default param = 255 + as5600.begin(); // set software direction control. default parameter == 255 as5600.setDirection(AS5600_CLOCK_WISE); // default, just be explicit. } @@ -39,7 +39,7 @@ void loop() if (counter < 10) as5600.setDirection(AS5600_CLOCK_WISE); else as5600.setDirection(AS5600_COUNTERCLOCK_WISE); if (counter >= 20) counter = 0; - + Serial.print(millis()); Serial.print("\t"); Serial.print(as5600.getDirection()); diff --git a/libraries/AS5600/examples/AS5600_demo_two_I2C/AS5600_demo_two_I2C.ino b/libraries/AS5600/examples/AS5600_demo_two_I2C/AS5600_demo_two_I2C.ino index 2600aea6..a3a165c8 100644 --- a/libraries/AS5600/examples/AS5600_demo_two_I2C/AS5600_demo_two_I2C.ino +++ b/libraries/AS5600/examples/AS5600_demo_two_I2C/AS5600_demo_two_I2C.ino @@ -36,7 +36,7 @@ void setup() Serial.print("Connect device 0: "); Serial.println(as5600_0.isConnected() ? "true" : "false"); delay(1000); - + as5600_1.begin(5); // set direction pin. as5600_1.setDirection(AS5600_COUNTERCLOCK_WISE); Serial.print("Connect device 1: "); diff --git a/libraries/AS5600/examples/AS5600_resetCumulativeCounter/AS5600_resetCumulativeCounter.ino b/libraries/AS5600/examples/AS5600_resetCumulativeCounter/AS5600_resetCumulativeCounter.ino index 7d219066..01232aa9 100644 --- a/libraries/AS5600/examples/AS5600_resetCumulativeCounter/AS5600_resetCumulativeCounter.ino +++ b/libraries/AS5600/examples/AS5600_resetCumulativeCounter/AS5600_resetCumulativeCounter.ino @@ -1,6 +1,6 @@ // // FILE: AS5600_resetCumulativeCounter.ino -// AUTHOR: Daniel-Frenkel, (slightly by Rob Tillaart) +// AUTHOR: Daniel-Frenkel, (slightly modified by Rob Tillaart) // PURPOSE: demo - see issue #30 // URL: https://github.com/RobTillaart/AS5600 // @@ -21,7 +21,7 @@ void setup() Serial.println(__FILE__); Serial.print("AS5600_LIB_VERSION: "); Serial.println(AS5600_LIB_VERSION); - + Wire.begin(14, 15); // ESP32 as5600.begin(); diff --git a/libraries/AS5600/library.json b/libraries/AS5600/library.json index d8398efd..39fe7d18 100644 --- a/libraries/AS5600/library.json +++ b/libraries/AS5600/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/AS5600.git" }, - "version": "0.6.0", + "version": "0.6.1", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/libraries/AS5600/library.properties b/libraries/AS5600/library.properties index 9e8d083b..12df09ef 100644 --- a/libraries/AS5600/library.properties +++ b/libraries/AS5600/library.properties @@ -1,5 +1,5 @@ name=AS5600 -version=0.6.0 +version=0.6.1 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for AS5600 and AS5600L magnetic rotation meter.