From cbbffdb59f83c9ffe020dd962e3fba5cd74783be Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Fri, 19 Apr 2024 19:37:04 +0200 Subject: [PATCH] 0.2.3 A1301 --- libraries/A1301/.arduino-ci.yml | 20 +++++- .../workflows/platformIO_test_runner.yml | 63 +++++++++++++++++++ libraries/A1301/A1301.cpp | 4 +- libraries/A1301/A1301.h | 6 +- libraries/A1301/CHANGELOG.md | 10 ++- libraries/A1301/README.md | 3 + .../A1301_autoMidPoint/A1301_autoMidPoint.ino | 1 - .../A1301/examples/A1301_demo/A1301_demo.ino | 1 - .../A1301_determineNoise.ino | 2 +- .../A1301_performance/A1301_performance.ino | 1 - .../examples/A1301_plotter/A1301_plotter.ino | 1 - .../A1301/examples/A1301_test/A1301_test.ino | 2 +- .../A1301_test_saturation.ino | 2 +- libraries/A1301/library.json | 2 +- libraries/A1301/library.properties | 2 +- 15 files changed, 102 insertions(+), 18 deletions(-) create mode 100644 libraries/A1301/.github/workflows/platformIO_test_runner.yml diff --git a/libraries/A1301/.arduino-ci.yml b/libraries/A1301/.arduino-ci.yml index 77a333f9..351ea033 100644 --- a/libraries/A1301/.arduino-ci.yml +++ b/libraries/A1301/.arduino-ci.yml @@ -1,7 +1,7 @@ platforms: rpipico: board: rp2040:rp2040:rpipico - package: rp2040:rp2040 + package: rp2040:rp2040 # name:architecture:board gcc: features: defines: @@ -9,9 +9,22 @@ platforms: warnings: flags: + teensy41: + board: teensy:Teensy:teensy41 + package: teensy:Teensy + gcc: + features: + defines: + - ARDUINO_TEENSY41 + warnings: + flags: + packages: rp2040:rp2040: url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json + teensy:Teensy: + url: https://www.pjrc.com/teensy/package_teensy_index.json + compile: # Choosing to run compilation tests on 2 different Arduino platforms @@ -20,9 +33,10 @@ compile: # - due # - zero # - leonardo - - m4 + #- m4 - esp32 - - esp8266 + #- esp8266 # - mega2560 - rpipico + # - teensy41 diff --git a/libraries/A1301/.github/workflows/platformIO_test_runner.yml b/libraries/A1301/.github/workflows/platformIO_test_runner.yml new file mode 100644 index 00000000..2f5874f9 --- /dev/null +++ b/libraries/A1301/.github/workflows/platformIO_test_runner.yml @@ -0,0 +1,63 @@ +# +# experimental +# +# https://docs.github.com/en/actions/ +# https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix +# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context +# + +name: PlatformIO CI + +on: [push] + +jobs: + build: + runs-on: ${{ matrix.os }} + timeout-minutes: 20 + strategy: + matrix: + os: [ubuntu-latest] + # add examples manually. + # ls -R examples/*/*.ino + # test sketch can be commented with a # + example: [ + examples/A1301_autoMidPoint/A1301_autoMidPoint.ino, + examples/A1301_demo/A1301_demo.ino, + examples/A1301_determineNoise/A1301_determineNoise.ino, + examples/A1301_performance/A1301_performance.ino, + examples/A1301_plotter/A1301_plotter.ino, + examples/A1301_test/A1301_test.ino, + examples/A1301_test_saturation/A1301_test_saturation.ino + ] + + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cache/pip + ~/.platformio/.cache + key: ${{ runner.os }}-pio + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install PlatformIO Core + run: pip install --upgrade platformio + + - name: Download library + run: | + wget https://github.com/${{github.repository}}/archive/${{github.ref_name}}.zip -O /tmp/${{github.ref_name}}.zip + unzip /tmp/${{github.ref_name}}.zip -d /tmp/${{github.actor}} + + - name: Build PlatformIO examples + run: pio ci --lib "." --lib="/tmp/${{github.repository}}-${{github.ref_name}}" --board=esp32dev + env: + PLATFORMIO_CI_SRC: ${{ matrix.example }} + # PLATFORMIO_BUILD_FLAGS: -D -Wall # too much + + - name: additional tests (experimental) + # /home/runner/work/A1301/A1301 => all examples are there... + run: | + pwd + diff --git a/libraries/A1301/A1301.cpp b/libraries/A1301/A1301.cpp index 83ae5666..3c774826 100644 --- a/libraries/A1301/A1301.cpp +++ b/libraries/A1301/A1301.cpp @@ -1,7 +1,7 @@ // // FILE: A1301.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.2.2 +// VERSION: 0.2.3 // DATE: 2010-07-22 // PURPOSE: Arduino library for A1301 A1302 magnetometer. // URL: https://github.com/RobTillaart/A1301 @@ -235,7 +235,7 @@ float HALL::saturationLevel() ///////////////////////////////////////////////////////////////////////////// // -// DERIVED +// DERIVED CLASSES // A1301::A1301(uint8_t pin) : HALL(pin) { diff --git a/libraries/A1301/A1301.h b/libraries/A1301/A1301.h index 5d97ab3e..2a54530b 100644 --- a/libraries/A1301/A1301.h +++ b/libraries/A1301/A1301.h @@ -2,7 +2,7 @@ // // FILE: A1301.h // AUTHOR: Rob Tillaart -// VERSION: 0.2.2 +// VERSION: 0.2.3 // DATE: 2010-07-22 // PURPOSE: Arduino library for A1301 A1302 magnetometer. // URL: https://github.com/RobTillaart/A1301 @@ -18,7 +18,7 @@ #include "Arduino.h" -#define A1301_LIB_VERSION (F("0.2.2")) +#define A1301_LIB_VERSION (F("0.2.3")) class HALL @@ -94,7 +94,7 @@ protected: //////////////////////////////////////////////////// // -// DERIVED +// DERIVED CLASSES // class A1301 : public HALL { diff --git a/libraries/A1301/CHANGELOG.md b/libraries/A1301/CHANGELOG.md index db43918f..32e962f9 100644 --- a/libraries/A1301/CHANGELOG.md +++ b/libraries/A1301/CHANGELOG.md @@ -6,12 +6,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.2.3] - 2024-04-19 +- update GitHub actions +- experimental PlatformIO build-CI +- add PlatformIO build badge in readme.md +- add Commits since last release badge in readme.md +- experimental Teensy build (no success yet) +- minor edits in examples. + + ## [0.2.2] - 2024-01-01 - add **float autoMidPoint(times)** - add examples - update readme.md - ## [0.2.1] - 2023-09-19 - add **bool isRising()** and **bool isFalling()** - add **float deltaGauss()** diff --git a/libraries/A1301/README.md b/libraries/A1301/README.md index 530a2326..367c8c3f 100644 --- a/libraries/A1301/README.md +++ b/libraries/A1301/README.md @@ -1,4 +1,5 @@ +[![PlatformIO CI](https://github.com/RobTillaart/A1301/workflows/PlatformIO%20CI/badge.svg)](https://docs.platformio.org/en/latest/integration/ci/github-actions.html) [![Arduino CI](https://github.com/RobTillaart/A1301/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) [![Arduino-lint](https://github.com/RobTillaart/A1301/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/A1301/actions/workflows/arduino-lint.yml) [![JSON check](https://github.com/RobTillaart/A1301/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/A1301/actions/workflows/jsoncheck.yml) @@ -8,6 +9,8 @@ [![GitHub release](https://img.shields.io/github/release/RobTillaart/A1301.svg?maxAge=3600)](https://github.com/RobTillaart/A1301/releases) [![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/A1301.svg)](https://registry.platformio.org/libraries/robtillaart/A1301) +[![Commits since latest](https://img.shields.io/github/commits-since/RobTillaart/A1301/latest)](https://github.com/RobTillaart/A1301/commits/master) + # A1301 diff --git a/libraries/A1301/examples/A1301_autoMidPoint/A1301_autoMidPoint.ino b/libraries/A1301/examples/A1301_autoMidPoint/A1301_autoMidPoint.ino index 64f49038..367f15e9 100644 --- a/libraries/A1301/examples/A1301_autoMidPoint/A1301_autoMidPoint.ino +++ b/libraries/A1301/examples/A1301_autoMidPoint/A1301_autoMidPoint.ino @@ -5,7 +5,6 @@ // URL: https://github.com/RobTillaart/A1301 -#include "Arduino.h" #include "A1301.h" A1301 mm(A0); diff --git a/libraries/A1301/examples/A1301_demo/A1301_demo.ino b/libraries/A1301/examples/A1301_demo/A1301_demo.ino index 8349e1c8..f1c08c4d 100644 --- a/libraries/A1301/examples/A1301_demo/A1301_demo.ino +++ b/libraries/A1301/examples/A1301_demo/A1301_demo.ino @@ -5,7 +5,6 @@ // URL: https://github.com/RobTillaart/A1301 -#include "Arduino.h" #include "A1301.h" A1301 mm(A0); diff --git a/libraries/A1301/examples/A1301_determineNoise/A1301_determineNoise.ino b/libraries/A1301/examples/A1301_determineNoise/A1301_determineNoise.ino index 4bb9aef3..5a11cd90 100644 --- a/libraries/A1301/examples/A1301_determineNoise/A1301_determineNoise.ino +++ b/libraries/A1301/examples/A1301_determineNoise/A1301_determineNoise.ino @@ -2,9 +2,9 @@ // FILE: A1301_determineNoise.ino // AUTHOR: Rob Tillaart // PURPOSE: demo A1301 A1302 magnetometer. +// URL: https://github.com/RobTillaart/A1301 -#include "Arduino.h" #include "A1301.h" A1301 mm(A0); diff --git a/libraries/A1301/examples/A1301_performance/A1301_performance.ino b/libraries/A1301/examples/A1301_performance/A1301_performance.ino index ec7c5cf0..82d8928a 100644 --- a/libraries/A1301/examples/A1301_performance/A1301_performance.ino +++ b/libraries/A1301/examples/A1301_performance/A1301_performance.ino @@ -5,7 +5,6 @@ // URL: https://github.com/RobTillaart/A1301 -#include "Arduino.h" #include "A1301.h" A1301 mm(A0); diff --git a/libraries/A1301/examples/A1301_plotter/A1301_plotter.ino b/libraries/A1301/examples/A1301_plotter/A1301_plotter.ino index fbade2c6..3961cbce 100644 --- a/libraries/A1301/examples/A1301_plotter/A1301_plotter.ino +++ b/libraries/A1301/examples/A1301_plotter/A1301_plotter.ino @@ -7,7 +7,6 @@ // to be used with Arduino Serial plotter -#include "Arduino.h" #include "A1301.h" diff --git a/libraries/A1301/examples/A1301_test/A1301_test.ino b/libraries/A1301/examples/A1301_test/A1301_test.ino index cfb8ea1c..1ccfb72a 100644 --- a/libraries/A1301/examples/A1301_test/A1301_test.ino +++ b/libraries/A1301/examples/A1301_test/A1301_test.ino @@ -2,9 +2,9 @@ // FILE: A1301_test.ino // AUTHOR: Rob Tillaart // PURPOSE: demo A1301 A1302 magnetometer. +// URL: https://github.com/RobTillaart/A1301 -#include "Arduino.h" #include "A1301.h" A1301 mm(A0); diff --git a/libraries/A1301/examples/A1301_test_saturation/A1301_test_saturation.ino b/libraries/A1301/examples/A1301_test_saturation/A1301_test_saturation.ino index ba74548c..1c7a6a93 100644 --- a/libraries/A1301/examples/A1301_test_saturation/A1301_test_saturation.ino +++ b/libraries/A1301/examples/A1301_test_saturation/A1301_test_saturation.ino @@ -2,9 +2,9 @@ // FILE: A1301_test_saturation.ino // AUTHOR: Rob Tillaart // PURPOSE: demo A1301 A1302 magnetometer. +// URL: https://github.com/RobTillaart/A1301 -#include "Arduino.h" #include "A1301.h" A1301 mm(A0); diff --git a/libraries/A1301/library.json b/libraries/A1301/library.json index fcd52142..b1584918 100644 --- a/libraries/A1301/library.json +++ b/libraries/A1301/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/A1301.git" }, - "version": "0.2.2", + "version": "0.2.3", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/libraries/A1301/library.properties b/libraries/A1301/library.properties index 8595f082..862cb8dd 100644 --- a/libraries/A1301/library.properties +++ b/libraries/A1301/library.properties @@ -1,5 +1,5 @@ name=A1301 -version=0.2.2 +version=0.2.3 author=Rob Tillaart maintainer=Rob Tillaart sentence=Arduino library for A1301 et al magnetometer.