diff --git a/.github/workflows/arduino-lint.yml b/.github/workflows/arduino-lint.yml index 7f8f4ef..aed264b 100644 --- a/.github/workflows/arduino-lint.yml +++ b/.github/workflows/arduino-lint.yml @@ -6,8 +6,8 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v4 - - uses: arduino/arduino-lint-action@v1 + - uses: actions/checkout@v6 + - uses: arduino/arduino-lint-action@v2 with: library-manager: update compliance: strict \ No newline at end of file diff --git a/.github/workflows/arduino_test_runner.yml b/.github/workflows/arduino_test_runner.yml index dbd0ce7..a2a5f07 100644 --- a/.github/workflows/arduino_test_runner.yml +++ b/.github/workflows/arduino_test_runner.yml @@ -6,9 +6,8 @@ jobs: runTest: runs-on: ubuntu-latest timeout-minutes: 20 - steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: ruby/setup-ruby@v1 with: ruby-version: 2.6 diff --git a/.github/workflows/jsoncheck.yml b/.github/workflows/jsoncheck.yml index 1cbb5e2..2c52dc7 100644 --- a/.github/workflows/jsoncheck.yml +++ b/.github/workflows/jsoncheck.yml @@ -5,13 +5,15 @@ on: paths: - '**.json' pull_request: + paths: + - '**.json' jobs: test: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: json-syntax-check uses: limitusus/json-syntax-check@v2 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f76799..81868a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,13 +6,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.4.3] - 2026-01-02 +- update GitHub actions +- update examples +- minor edits + ## [0.4.2] - 2024-02-02 - update readme.md - a.o. rewrite description, future section. - minor refactor examples - minor edits - ## [0.4.1] - 2023-10-30 - update readme.md (badges). - add performance test example (another). diff --git a/FastMap.cpp b/FastMap.cpp index f7a4cfc..96c8247 100644 --- a/FastMap.cpp +++ b/FastMap.cpp @@ -1,7 +1,7 @@ // // FILE: FastMap.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.4.2 +// VERSION: 0.4.3 // PURPOSE: class with fast map function - library for Arduino // URL: https://github.com/RobTillaart/FastMap diff --git a/FastMap.h b/FastMap.h index 47cff1a..db63043 100644 --- a/FastMap.h +++ b/FastMap.h @@ -2,14 +2,14 @@ // // FILE: FastMap.h // AUTHOR: Rob Tillaart -// VERSION: 0.4.2 +// VERSION: 0.4.3 // PURPOSE: class with fast map function - library for Arduino // URL: https://github.com/RobTillaart/FastMap #include "Arduino.h" -#define FASTMAP_LIB_VERSION (F("0.4.2")) +#define FASTMAP_LIB_VERSION (F("0.4.3")) class FastMap diff --git a/LICENSE b/LICENSE index 3584769..c828586 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2010-2024 Rob Tillaart +Copyright (c) 2010-2026 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 2b364f2..402cc18 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,9 @@ This is to prevent NaN errors and **init()** will return false if such range is If the **init()** function is not called a 1 to 1 mapping is used. -#### Related +Feedback as always is welcome. + +### Related Other mapping libraries @@ -56,6 +58,9 @@ Other mapping libraries - https://github.com/RobTillaart/moduloMap - https://github.com/RobTillaart/MultiMap +Additional fast mapping investigated by brewmanz can be found here: +- https://github.com/RobTillaart/FastMap/pull/9 + ## Performance notes @@ -92,7 +97,7 @@ Furthermore using double might imply a performance penalty on some platforms. #include "FastMap.h" ``` -#### Base +### Base - **FastMap()** Constructor - **bool init(float in_min, float in_max, float out_min, float out_max)** defines the linear mapping parameters. @@ -106,7 +111,7 @@ If **init()** is not called the default is 1 to 1 mapping. - **float back(float value)** does the inverse mapping. -#### Constrains +### Constrains FastMap supports three versions of constraining the map function, based upon the parameters of **init()**. @@ -130,7 +135,7 @@ Note that on most embedded platforms the performance of doubles is less than flo See below. -#### boards supporting double +### boards supporting double | board | float | double | |:---------------|:-------:|:--------:| @@ -198,6 +203,9 @@ FM.init(in_min, in_max, 0.0, 100.0); #### Should +- investigate exponential mapping: ```x -> alpha * beta^x```?? + - gamma mapping, some curve from A->B + #### Could @@ -205,7 +213,6 @@ FM.init(in_min, in_max, 0.0, 100.0); - investigate map function for complex numbers? / coordinates? - what does linear interpolation mean, map an input area upon an output area? - Template class? -- investigate exponential mapping: ```x -> alpha * beta^x```?? - do we need **constrainedBack()**? in three versions? #### Wont diff --git a/examples/constrainedMapDemo/constrainedMapDemo.ino b/examples/constrainedMapDemo/constrainedMapDemo.ino index 4cd116b..be339e7 100644 --- a/examples/constrainedMapDemo/constrainedMapDemo.ino +++ b/examples/constrainedMapDemo/constrainedMapDemo.ino @@ -13,6 +13,7 @@ FastMap mapper; void setup() { Serial.begin(115200); + Serial.println(); Serial.println(__FILE__); Serial.print("FASTMAP_LIB_VERSION: "); Serial.println(FASTMAP_LIB_VERSION); diff --git a/examples/fastMapDemo/fastMapDemo.ino b/examples/fastMapDemo/fastMapDemo.ino index 90478ea..1e40f32 100644 --- a/examples/fastMapDemo/fastMapDemo.ino +++ b/examples/fastMapDemo/fastMapDemo.ino @@ -20,6 +20,7 @@ FastMap mapper; void setup() { Serial.begin(115200); + Serial.println(); Serial.println(__FILE__); Serial.print("FASTMAP_LIB_VERSION: "); Serial.println(FASTMAP_LIB_VERSION); diff --git a/examples/fastMapDemo2/fastMapDemo2.ino b/examples/fastMapDemo2/fastMapDemo2.ino index e355771..edfaad8 100644 --- a/examples/fastMapDemo2/fastMapDemo2.ino +++ b/examples/fastMapDemo2/fastMapDemo2.ino @@ -14,6 +14,7 @@ FastMap FtoC; // Fahrenheit to Celsius void setup() { Serial.begin(115200); + Serial.println(); Serial.println(__FILE__); Serial.print("FASTMAP_LIB_VERSION: "); Serial.println(FASTMAP_LIB_VERSION); diff --git a/examples/fastMapDemo3/fastMapDemo3.ino b/examples/fastMapDemo3/fastMapDemo3.ino index c70cce7..1b982b0 100644 --- a/examples/fastMapDemo3/fastMapDemo3.ino +++ b/examples/fastMapDemo3/fastMapDemo3.ino @@ -13,6 +13,7 @@ FastMap CtoF; // Celsius to Fahrenheit void setup() { Serial.begin(115200); + Serial.println(); Serial.println(__FILE__); Serial.print("FASTMAP_LIB_VERSION: "); Serial.println(FASTMAP_LIB_VERSION); diff --git a/examples/fastMapDemo4/fastMapDemo4.ino b/examples/fastMapDemo4/fastMapDemo4.ino index 234abaf..82ff01d 100644 --- a/examples/fastMapDemo4/fastMapDemo4.ino +++ b/examples/fastMapDemo4/fastMapDemo4.ino @@ -20,6 +20,7 @@ FastMap mapper; void setup() { Serial.begin(115200); + Serial.println(); Serial.println(__FILE__); Serial.print("FASTMAP_LIB_VERSION: "); Serial.println(FASTMAP_LIB_VERSION); diff --git a/examples/fastMapDouble/fastMapDouble.ino b/examples/fastMapDouble/fastMapDouble.ino index d17c5a1..722d486 100644 --- a/examples/fastMapDouble/fastMapDouble.ino +++ b/examples/fastMapDouble/fastMapDouble.ino @@ -21,6 +21,7 @@ FastMapDouble mapper; void setup() { Serial.begin(115200); + Serial.println(); Serial.println(__FILE__); Serial.print("FASTMAP_LIB_VERSION: "); Serial.println(FASTMAP_LIB_VERSION); diff --git a/library.json b/library.json index 28476d7..de29d1d 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/FastMap" }, - "version": "0.4.2", + "version": "0.4.3", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/library.properties b/library.properties index 8c127d7..70a7b69 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=FastMap -version=0.4.2 +version=0.4.3 author=Rob Tillaart maintainer=Rob Tillaart sentence=Library with fast map function for Arduino.