From b088a0b3514e0ef06c771a778e70390484e97768 Mon Sep 17 00:00:00 2001 From: PhilippTilser <151649003+PhilippTilser@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:08:22 +0100 Subject: [PATCH 1/2] Update AS5601.h Replaced Min(),Max() with constrain --- AS5601.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AS5601.h b/AS5601.h index 3b5a9a1..9d21dba 100644 --- a/AS5601.h +++ b/AS5601.h @@ -177,7 +177,7 @@ class AS5601 char power = -1; // coerce angle steps to supported values (8, 16, 32, …, 2048) - angleSteps = min( max( angleSteps, 8 ), 2048 ); + angleSteps = constrain(angleSteps, 8, 2048); // find dual logarithm (2^power >= angleSteps) // (by comparing increasing powers of two with angleSteps) From 6ca986fcdcd7120435cd95a133b47b051d9365cd Mon Sep 17 00:00:00 2001 From: PhilippTilser <151649003+PhilippTilser@users.noreply.github.com> Date: Mon, 18 Mar 2024 18:13:42 +0100 Subject: [PATCH 2/2] Create library.json PlatformIO --- library.json | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 library.json diff --git a/library.json b/library.json new file mode 100644 index 0000000..961f83c --- /dev/null +++ b/library.json @@ -0,0 +1,29 @@ +{ + "name": "AS5601 Library for Arduino", + "version": "0.1.0", + "description": "A wrapper for driving the cheap but great magnetic rotary sensor AS5601 over I²C on an Arduino. The library aims to offer clean high-level access to the sensor's capabilities and to provide convenience functions for common tasks. The current implementation supports only a subset of the sensor's functionality, more functions may be added in future versions.", + "keywords": "AS5601, Encoder, Rotary, Osram , AMS, 12-Bit, Programmable, Contactless", + "repository": + { + "type": "git", + "url": "https://github.com/bitfasching/AS5601.git" + }, + "authors": + [ + { + "name": "bitfasching ", + "url": "https://www.bitfasching.de" + }, + { + "name": "George Zogopoulos-Papaliakos ", + "email": "tailwhipx4@gmail.com", + "maintainer": true + }, + { + "name": "Yannik Stradmann" + } + ], + "license": "BSD-3-Clause", + "frameworks": "Arduino", + "platforms": "Arduino,STM32,ESP32" +}