From 34d0a17e328380d0c9735f5cafaf25f96732b31b Mon Sep 17 00:00:00 2001 From: "Jonas Merke [JJM]" Date: Sat, 19 Oct 2024 23:30:55 +0200 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typos=20in=20REA?= =?UTF-8?q?DME.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 150 +++++++++++++++++++++++++++--------------------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/README.md b/README.md index 2cb6c0c..856248e 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ - [Documentation](#documentation) - [How to install this library](#how-to-install-this-library) - [Install the library via the Arduino Library Manager](#install-the-library-via-the-arduino-library-manager) - - [Manually install a Arduino library](#manually-install-a-arduino-library) - - [Install the library via the PlattformIO Library Manager](#install-the-library-via-the-plattformio-library-manager) + - [Manually install an Arduino library](#manually-install-an-arduino-library) + - [Install the library via the PlatformIO Library Manager](#install-the-library-via-the-platformio-library-manager) - [How to connect the AS5047P to your Arduino](#how-to-connect-the-as5047p-to-your-arduino) - [Connect to an Arduino Uno](#connect-to-an-arduino-uno) - [Connect to an Arduino Mega](#connect-to-an-arduino-mega) @@ -30,7 +30,7 @@ ## Supported Sensors -The following sensors of the **AS5x47** series of rotary potion sensors are supported by this library: +The following sensors of the **AS5x47** series of rotary position sensors are supported by this library: - [**AS5047P**](https://ams.com/documents/20143/36005/AS5047P_DS000324_2-00.pdf/a7d44138-51f1-2f6e-c8b6-2577b369ace8) - [**AS5047D**](https://ams.com/documents/20143/36005/AS5047D_DS000394_2-00.pdf/c7225c06-112f-82c5-4471-17a2711a7f0e) @@ -38,7 +38,7 @@ The following sensors of the **AS5x47** series of rotary potion sensors are supp - [**AS5147P**](https://ams.com/documents/20143/36005/AS5147P_DS000328_2-00.pdf/847d41be-7afa-94ad-98c2-8617a5df5b6f) - [**AS5247**](https://ams.com/documents/20143/36005/AS5247_DS000354_2-00.pdf/db765ebd-b442-4d00-8343-d4f95a847995) -You can get the **AS5047P** sensor preinstalled on a breakout board [here](https://ams.com/as5047padapterboard). +You can get the **AS5047P** sensor pre-installed on a breakout board [here](https://ams.com/as5047padapterboard). Not supported are the following sensors: @@ -59,53 +59,53 @@ Documentation Deployment Status: ![GitHub deployments](https://img.shields.io/gi ### Install the library via the Arduino Library Manager -The easiest way to install this library is to use the build in Arduino Library Manager. Just search for `AS5047P` an install the latest version available. You can also upgrade the library to the newest release via the Arduino Library Manager. For detailed information please read the section `Using the Library Manager` of [this](https://www.arduino.cc/en/guide/libraries) tutorial. (Pleas keep in mind you need at least version 1.6.2 of the Arduino IDE in order to use the Arduino Library Manager) +The easiest way to install this library is to use the built-in Arduino Library Manager. Just search for `AS5047P` and install the latest version available. You can also upgrade the library to the newest release via the Arduino Library Manager. For detailed information, please read the section `Using the Library Manager` of [this](https://www.arduino.cc/en/guide/libraries) tutorial. (Please keep in mind you need at least version 1.6.2 of the Arduino IDE in order to use the Arduino Library Manager.) -### Manually install a Arduino library +### Manually install an Arduino library You can download the latest version of this library [here](https://github.com/jonas-merkle/AS5047P/releases) as a zip file and follow the section `Importing a .zip Library` or `Manual installation` of [this](https://www.arduino.cc/en/guide/libraries) tutorial about `How to Install a Library`. -### Install the library via the PlattformIO Library Manager +### Install the library via the PlatformIO Library Manager -You can find this library [here](https://platformio.org/lib/show/12035/AS5047P) in the PlattformIO Library Manager. To add this library to your plattformIO project you can either use the library manager ui and search for this library or you can use the following platform io cli command: `pio lib install "jonas-merkle/AS5047P"` +You can find this library [here](https://platformio.org/lib/show/12035/AS5047P) in the PlatformIO Library Manager. To add this library to your PlatformIO project, you can either use the library manager UI and search for this library or you can use the following PlatformIO CLI command: `pio lib install "jonas-merkle/AS5047P"` ## How to connect the AS5047P to your Arduino ### Connect to an [Arduino Uno](https://store.arduino.cc/arduino-uno-rev3) | AS5047P Pin | Arduino Uno Pin | Comment | -|:-----------:|:-----------:|:--------| -| GND | GND | - | -| VDD | 5V | - | -| VDD3V| NC | - | -| MOSI | MOSI (Pin: 11) | - | -| MISO | MISO (Pin: 12) | - | -| CLK | SCK (Pin: 13) | - | -| CSn | 9 | Can be any unused digital pin on the arduino as long as it's configured here `AS5047P as5047p();` | +|:-----------:|:---------------:|:--------| +| GND | GND | - | +| VDD | 5V | - | +| VDD3V | NC | - | +| MOSI | MOSI (Pin: 11) | - | +| MISO | MISO (Pin: 12) | - | +| CLK | SCK (Pin: 13) | - | +| CSn | 9 | Can be any unused digital pin on the Arduino as long as it's configured here `AS5047P as5047p();` | ### Connect to an [Arduino Mega](https://store.arduino.cc/arduino-mega-2560-rev3) | AS5047P Pin | Arduino Mega Pin | Comment | -|:-----------:|:-----------:|:--------| -| GND | GND | - | -| VDD | 5V | - | -| VDD3V| NC | - | -| MOSI | MOSI (Pin: 51) | - | -| MISO | MISO (Pin: 50) | - | -| CLK | SCK (Pin: 52) | - | -| CSn | 9 | Can be any unused digital pin on the arduino as long as it's configured here `AS5047P as5047p();` | +|:-----------:|:----------------:|:--------| +| GND | GND | - | +| VDD | 5V | - | +| VDD3V | NC | - | +| MOSI | MOSI (Pin: 51) | - | +| MISO | MISO (Pin: 50) | - | +| CLK | SCK (Pin: 52) | - | +| CSn | 9 | Can be any unused digital pin on the Arduino as long as it's configured here `AS5047P as5047p();` | ### Connect to an [Adafruit Feather M0](https://www.adafruit.com/product/2772) | AS5047P Pin | Adafruit Feather M0 Pin | Comment | -|:-----------:|:-----------:|:--------| -| GND | GND | - | -| VDD | 3V | - | -| VDD3V| 3V | - | -| MOSI | MOSI | - | -| MISO | MISO | - | -| CLK | SCK | - | -| CSn | 9 | Can be any unused digital pin on the arduino as long as it's configured here `AS5047P as5047p();` | +|:-----------:|:-----------------------:|:--------| +| GND | GND | - | +| VDD | 3V | - | +| VDD3V | 3V | - | +| MOSI | MOSI | - | +| MISO | MISO | - | +| CLK | SCK | - | +| CSn | 9 | Can be any unused digital pin on the Arduino as long as it's configured here `AS5047P as5047p();` | **Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Adafruit Feather M0 board!** @@ -113,57 +113,57 @@ You can find this library [here](https://platformio.org/lib/show/12035/AS5047P) #### Connect to a [Teensy 3.5](https://www.pjrc.com/store/teensy35.html) -| AS5047P Pin | Teensy Pin | Comment | -|:-----------:|:-----------:|:--------| -| GND | GND | - | -| VDD | 3V | - | -| VDD3V| 3V | - | -| MOSI | MOSI0 (Pin: 11) | - | -| MISO | MISO0 (Pin: 12) | - | -| CLK | SCK0 (Pin: 13) | - | -| CSn | CS0 (Pin: 10) | Can be any unused digital pin on the teensy as long as it's configured here `AS5047P as5047p();` | +| AS5047P Pin | Teensy Pin | Comment | +|:-----------:|:---------------:|:--------| +| GND | GND | - | +| VDD | 3V | - | +| VDD3V | 3V | - | +| MOSI | MOSI0 (Pin: 11) | - | +| MISO | MISO0 (Pin: 12) | - | +| CLK | SCK0 (Pin: 13) | - | +| CSn | CS0 (Pin: 10) | Can be any unused digital pin on the Teensy as long as it's configured here `AS5047P as5047p();` | **Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!** #### Connect to a [Teensy 3.6](https://www.pjrc.com/store/teensy36.html) -| AS5047P Pin | Teensy Pin | Comment | -|:-----------:|:-----------:|:--------| -| GND | GND | - | -| VDD | 3V | - | -| VDD3V| 3V | - | -| MOSI | MOSI0 (Pin: 11) | - | -| MISO | MISO0 (Pin: 12) | - | -| CLK | SCK0 (Pin: 13) | - | -| CSn | CS0 (Pin: 10) | Can be any unused digital pin on the teensy as long as it's configured here `AS5047P as5047p();` | +| AS5047P Pin | Teensy Pin | Comment | +|:-----------:|:---------------:|:--------| +| GND | GND | - | +| VDD | 3V | - | +| VDD3V | 3V | - | +| MOSI | MOSI0 (Pin: 11) | - | +| MISO | MISO0 (Pin: 12) | - | +| CLK | SCK0 (Pin: 13) | - | +| CSn | CS0 (Pin: 10) | Can be any unused digital pin on the Teensy as long as it's configured here `AS5047P as5047p();` | **Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!** #### Connect to a [Teensy 4.0](https://www.pjrc.com/store/teensy40.html) -| AS5047P Pin | Teensy Pin | Comment | -|:-----------:|:-----------:|:--------| -| GND | GND | - | -| VDD | 3V | - | -| VDD3V| 3V | - | -| MOSI | MOSI (Pin: 11) | - | -| MISO | MISO (Pin: 12) | - | -| CLK | SCK (Pin: 13) | - | -| CSn | CS (Pin: 10) | Can be any unused digital pin on the teensy as long as it's configured here `AS5047P as5047p();` | +| AS5047P Pin | Teensy Pin | Comment | +|:-----------:|:---------------:|:--------| +| GND | GND | - | +| VDD | 3V | - | +| VDD3V | 3V | - | +| MOSI | MOSI (Pin: 11) | - | +| MISO | MISO (Pin: 12) | - | +| CLK | SCK (Pin: 13) | - | +| CSn | CS (Pin: 10) | Can be any unused digital pin on the Teensy as long as it's configured here `AS5047P as5047p();` | **Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!** #### Connect to a [Teensy 4.1](https://www.pjrc.com/store/teensy41.html) -| AS5047P Pin | Teensy Pin | Comment | -|:-----------:|:-----------:|:--------| -| GND | GND | - | -| VDD | 3V | - | -| VDD3V| 3V | - | -| MOSI | MOSI (Pin: 11) | - | -| MISO | MISO (Pin: 12) | - | -| CLK | SCK (Pin: 13) | - | -| CSn | CS (Pin: 10) | Can be any unused digital pin on the teensy as long as it's configured here `AS5047P as5047p();` | +| AS5047P Pin | Teensy Pin | Comment | +|:-----------:|:---------------:|:--------| +| GND | GND | - | +| VDD | 3V | - | +| VDD3V | 3V | - | +| MOSI | MOSI (Pin: 11) | - | +| MISO | MISO (Pin: 12) | - | +| CLK | SCK (Pin: 13) | - | +| CSn | CS (Pin: 10) | Can be any unused digital pin on the Teensy as long as it's configured here `AS5047P as5047p();` | **Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!** @@ -176,8 +176,8 @@ You can find this library [here](https://platformio.org/lib/show/12035/AS5047P) | ✅ | [BasicReadAngle.ino](examples/BasicReadAngle/BasicReadAngle.ino) successfully tested on an Arduino Mega & Adafruit Feather M0 | | ✅ | [BasicReadAngleAndDebugInfo.ino](examples/BasicReadAngleAndDebugInfo/BasicReadAngleAndDebugInfo.ino) successfully tested on an Arduino Mega & Adafruit Feather M0 | | ✅ | [PrintAllSettings.ino](examples/PrintAllSettings/PrintAllSettings.ino) successfully tested on an Arduino Mega & Adafruit Feather M0 | -| ✅ | Adding a CI pipline. | -| ✅ | Build & deploy doxygen documentation for the library. | +| ✅ | Adding a CI pipeline. | +| ✅ | Build & deploy Doxygen documentation for the library. | | ✅ | Sensor status output as string. | | ✅ | [keywords.txt](keywords.txt) updated for main library functions. | | ✅ | Switch to unions... | @@ -186,13 +186,13 @@ You can find this library [here](https://platformio.org/lib/show/12035/AS5047P) | ✅ | Improve initSPI() | | ✅ | ToString() for Error_t | | ✅ | Adding Library to Arduino Library Manager 🥳 | -| ✅ | Adding Library to PlattformIO Library Manager 🥳 | -| ✅ | Documentation update.| +| ✅ | Adding Library to PlatformIO Library Manager 🥳 | +| ✅ | Documentation update. | | ✅ | [keywords.txt](keywords.txt) updated for all library functions. | -| 🚧 | [Readme.md](README.md) update.| -| 🚧 | Test of all wirte functions | +| 🚧 | [Readme.md](README.md) update. | +| 🚧 | Test of all write functions | | 🚧 | Test of all read functions | | ❌ | Porting the library to be compatible with the STM32 HAL | | ❌ | Additional examples. | | ❌ | Unit Tests?! | -| ❌ | Implementation & test of programming the one time programmable register of the AS5047P. | +| ❌ | Implementation & test of programming the one-time programmable register of the AS5047P. | From 08eadff919d63d3e35b29ff62aece18ec916c7b2 Mon Sep 17 00:00:00 2001 From: "Jonas Merke [JJM]" Date: Sat, 19 Oct 2024 23:36:18 +0200 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=93=9D=20Update=20to=20the=20document?= =?UTF-8?q?aion=20in=20the=20README.md=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 247 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 156 insertions(+), 91 deletions(-) diff --git a/README.md b/README.md index 856248e..df2298c 100644 --- a/README.md +++ b/README.md @@ -2,31 +2,46 @@ ![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/jonas-merkle/AS5047P/Arduino-Library-CI.yml?branch=master&label=build%20master) ![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/jonas-merkle/AS5047P/Arduino-Library-CI.yml?branch=develop&label=build%20develop) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/jonas-merkle/AS5047P) ![GitHub](https://img.shields.io/github/license/jonas-merkle/AS5047P) ![GitHub issues](https://img.shields.io/github/issues/jonas-merkle/AS5047P) ![GitHub pull requests](https://img.shields.io/github/issues-pr/jonas-merkle/AS5047P) ![Maintenance](https://img.shields.io/maintenance/yes/2024) -## tl;dr +## Overview -**An Arduino library for the AS5047P high-resolution rotary position sensor. Supporting also the following sensor types: AS5047D, AS5147, AS5147P, AS5247** +The **AS5047P Arduino Library** provides an easy way to interface with the AS5047P high-resolution rotary position sensor, as well as several other sensors from the AS5x47 series. This library supports reading the angular position and other diagnostic information using SPI communication, and is designed to work with a variety of microcontrollers, including Arduino, Adafruit Feather, and Teensy boards. + +The AS5047P sensor provides high-resolution rotary position sensing with a 14-bit resolution, making it ideal for applications that require accurate angular measurements, such as robotics, motor control, and industrial automation. + +## Features + +- Support for multiple sensor models: AS5047P, AS5047D, AS5147, AS5147P, and AS5247. +- Easy-to-use interface for reading angular position. +- SPI communication for reliable data transmission. +- Example sketches to help get started quickly. +- Compatibility with Arduino, Adafruit Feather, Teensy, and other boards. ## Contents - [AS5047P - Arduino Library](#as5047p---arduino-library) - - [tl;dr](#tldr) + - [Overview](#overview) + - [Features](#features) - [Contents](#contents) - [Supported Sensors](#supported-sensors) - [Documentation](#documentation) - - [How to install this library](#how-to-install-this-library) - - [Install the library via the Arduino Library Manager](#install-the-library-via-the-arduino-library-manager) - - [Manually install an Arduino library](#manually-install-an-arduino-library) - - [Install the library via the PlatformIO Library Manager](#install-the-library-via-the-platformio-library-manager) - - [How to connect the AS5047P to your Arduino](#how-to-connect-the-as5047p-to-your-arduino) - - [Connect to an Arduino Uno](#connect-to-an-arduino-uno) - - [Connect to an Arduino Mega](#connect-to-an-arduino-mega) - - [Connect to an Adafruit Feather M0](#connect-to-an-adafruit-feather-m0) - - [Connect to Teensy Board](#connect-to-teensy-board) - - [Connect to a Teensy 3.5](#connect-to-a-teensy-35) - - [Connect to a Teensy 3.6](#connect-to-a-teensy-36) - - [Connect to a Teensy 4.0](#connect-to-a-teensy-40) - - [Connect to a Teensy 4.1](#connect-to-a-teensy-41) - - [Project Status \& ToDo's](#project-status--todos) + - [Installation Instructions](#installation-instructions) + - [Install via Arduino Library Manager](#install-via-arduino-library-manager) + - [Manual Installation](#manual-installation) + - [Install via PlatformIO Library Manager](#install-via-platformio-library-manager) + - [Connecting the AS5047P to Your Arduino](#connecting-the-as5047p-to-your-arduino) + - [Arduino Uno](#arduino-uno) + - [Arduino Mega](#arduino-mega) + - [Adafruit Feather M0](#adafruit-feather-m0) + - [Teensy Board Connections](#teensy-board-connections) + - [Teensy 3.5](#teensy-35) + - [Teensy 3.6](#teensy-36) + - [Teensy 4.0](#teensy-40) + - [Teensy 4.1](#teensy-41) + - [Usage Guide](#usage-guide) + - [Basic Example](#basic-example) + - [Advanced Usage](#advanced-usage) + - [License](#license) + - [Project Status \& To-Do's](#project-status--to-dos) ## Supported Sensors @@ -38,8 +53,6 @@ The following sensors of the **AS5x47** series of rotary position sensors are su - [**AS5147P**](https://ams.com/documents/20143/36005/AS5147P_DS000328_2-00.pdf/847d41be-7afa-94ad-98c2-8617a5df5b6f) - [**AS5247**](https://ams.com/documents/20143/36005/AS5247_DS000354_2-00.pdf/db765ebd-b442-4d00-8343-d4f95a847995) -You can get the **AS5047P** sensor pre-installed on a breakout board [here](https://ams.com/as5047padapterboard). - Not supported are the following sensors: - [AS5047U](https://ams.com/documents/20143/36005/AS5047U_DS000637_1-00.pdf/8639418f-6c3a-1624-4e6f-18f52c962099) @@ -48,126 +61,177 @@ Not supported are the following sensors: ## Documentation -Documentation Deployment Status: ![GitHub deployments](https://img.shields.io/github/deployments/jonas-merkle/AS5047P/github-pages) +The library documentation is deployed on GitHub Pages. For detailed reference on the API, examples, and usage guides, check the links below: | Branch | Link | |--------|------| | Master | [Documentation](https://jonas-merkle.github.io/AS5047P/docs/master/html/index.html) | | Develop | [Documentation](https://jonas-merkle.github.io/AS5047P/docs/develop/html/index.html) | -## How to install this library +## Installation Instructions + +### Install via Arduino Library Manager -### Install the library via the Arduino Library Manager +The easiest way to install this library is to use the built-in Arduino Library Manager: -The easiest way to install this library is to use the built-in Arduino Library Manager. Just search for `AS5047P` and install the latest version available. You can also upgrade the library to the newest release via the Arduino Library Manager. For detailed information, please read the section `Using the Library Manager` of [this](https://www.arduino.cc/en/guide/libraries) tutorial. (Please keep in mind you need at least version 1.6.2 of the Arduino IDE in order to use the Arduino Library Manager.) +1. Open the Arduino IDE. +2. Go to **Sketch > Include Library > Manage Libraries...** +3. In the Library Manager, type `AS5047P` in the search bar. +4. Install the latest version of the library. -### Manually install an Arduino library +You can also upgrade the library to the newest release via the Arduino Library Manager. For more information, refer to the [Arduino Libraries Guide](https://www.arduino.cc/en/guide/libraries). Note that you need at least version 1.6.2 of the Arduino IDE to use the Library Manager. -You can download the latest version of this library [here](https://github.com/jonas-merkle/AS5047P/releases) as a zip file and follow the section `Importing a .zip Library` or `Manual installation` of [this](https://www.arduino.cc/en/guide/libraries) tutorial about `How to Install a Library`. +### Manual Installation -### Install the library via the PlatformIO Library Manager +1. Download the latest version of the library from [GitHub Releases](https://github.com/jonas-merkle/AS5047P/releases). +2. Extract the downloaded ZIP file. +3. Copy the extracted folder to your Arduino libraries directory (e.g., `Documents/Arduino/libraries`). -You can find this library [here](https://platformio.org/lib/show/12035/AS5047P) in the PlatformIO Library Manager. To add this library to your PlatformIO project, you can either use the library manager UI and search for this library or you can use the following PlatformIO CLI command: `pio lib install "jonas-merkle/AS5047P"` +Follow the [Arduino Libraries Guide](https://www.arduino.cc/en/guide/libraries) for more detailed instructions. -## How to connect the AS5047P to your Arduino +### Install via PlatformIO Library Manager -### Connect to an [Arduino Uno](https://store.arduino.cc/arduino-uno-rev3) +To add this library to your PlatformIO project, follow these steps: + +1. Open PlatformIO IDE. +2. Search for `AS5047P` in the Library Manager UI, or run the following command in the PlatformIO CLI: + ``` + pio lib install "jonas-merkle/AS5047P" + ``` + +## Connecting the AS5047P to Your Arduino + +### Arduino Uno | AS5047P Pin | Arduino Uno Pin | Comment | |:-----------:|:---------------:|:--------| -| GND | GND | - | -| VDD | 5V | - | -| VDD3V | NC | - | -| MOSI | MOSI (Pin: 11) | - | -| MISO | MISO (Pin: 12) | - | -| CLK | SCK (Pin: 13) | - | -| CSn | 9 | Can be any unused digital pin on the Arduino as long as it's configured here `AS5047P as5047p();` | +| GND | GND | Ground connection | +| VDD | 5V | Power supply (5V) | +| VDD3V | NC | Not connected | +| MOSI | MOSI (Pin: 11) | SPI Data Out | +| MISO | MISO (Pin: 12) | SPI Data In | +| CLK | SCK (Pin: 13) | SPI Clock | +| CSn | 9 | Chip select (configurable pin) | -### Connect to an [Arduino Mega](https://store.arduino.cc/arduino-mega-2560-rev3) +### Arduino Mega | AS5047P Pin | Arduino Mega Pin | Comment | |:-----------:|:----------------:|:--------| -| GND | GND | - | -| VDD | 5V | - | -| VDD3V | NC | - | -| MOSI | MOSI (Pin: 51) | - | -| MISO | MISO (Pin: 50) | - | -| CLK | SCK (Pin: 52) | - | -| CSn | 9 | Can be any unused digital pin on the Arduino as long as it's configured here `AS5047P as5047p();` | +| GND | GND | Ground connection | +| VDD | 5V | Power supply (5V) | +| VDD3V | NC | Not connected | +| MOSI | MOSI (Pin: 51) | SPI Data Out | +| MISO | MISO (Pin: 50) | SPI Data In | +| CLK | SCK (Pin: 52) | SPI Clock | +| CSn | 9 | Chip select (configurable pin) | -### Connect to an [Adafruit Feather M0](https://www.adafruit.com/product/2772) +### Adafruit Feather M0 | AS5047P Pin | Adafruit Feather M0 Pin | Comment | |:-----------:|:-----------------------:|:--------| -| GND | GND | - | -| VDD | 3V | - | -| VDD3V | 3V | - | -| MOSI | MOSI | - | -| MISO | MISO | - | -| CLK | SCK | - | -| CSn | 9 | Can be any unused digital pin on the Arduino as long as it's configured here `AS5047P as5047p();` | +| GND | GND | Ground connection | +| VDD | 3V | Power supply (3.3V) | +| VDD3V | 3V | Power supply (3.3V) | +| MOSI | MOSI | SPI Data Out | +| MISO | MISO | SPI Data In | +| CLK | SCK | SPI Clock | +| CSn | 9 | Chip select (configurable pin) | -**Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Adafruit Feather M0 board!** +**Warning: Ensure the sensor is powered with 3.3V to avoid damage to the Adafruit Feather M0 board.** -### Connect to [Teensy Board](https://www.pjrc.com/store/index.html) +### Teensy Board Connections -#### Connect to a [Teensy 3.5](https://www.pjrc.com/store/teensy35.html) +#### Teensy 3.5 | AS5047P Pin | Teensy Pin | Comment | |:-----------:|:---------------:|:--------| -| GND | GND | - | -| VDD | 3V | - | -| VDD3V | 3V | - | -| MOSI | MOSI0 (Pin: 11) | - | -| MISO | MISO0 (Pin: 12) | - | -| CLK | SCK0 (Pin: 13) | - | -| CSn | CS0 (Pin: 10) | Can be any unused digital pin on the Teensy as long as it's configured here `AS5047P as5047p();` | +| GND | GND | Ground connection | +| VDD | 3V | Power supply (3.3V) | +| VDD3V | 3V | Power supply (3.3V) | +| MOSI | MOSI0 (Pin: 11) | SPI Data Out | +| MISO | MISO0 (Pin: 12) | SPI Data In | +| CLK | SCK0 (Pin: 13) | SPI Clock | +| CSn | CS0 (Pin: 10) | Chip select (configurable pin) | -**Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!** +**Warning: Ensure the sensor is powered with 3.3V to avoid damage to the Teensy board.** -#### Connect to a [Teensy 3.6](https://www.pjrc.com/store/teensy36.html) +#### Teensy 3.6 | AS5047P Pin | Teensy Pin | Comment | |:-----------:|:---------------:|:--------| -| GND | GND | - | -| VDD | 3V | - | -| VDD3V | 3V | - | -| MOSI | MOSI0 (Pin: 11) | - | -| MISO | MISO0 (Pin: 12) | - | -| CLK | SCK0 (Pin: 13) | - | -| CSn | CS0 (Pin: 10) | Can be any unused digital pin on the Teensy as long as it's configured here `AS5047P as5047p();` | +| GND | GND | Ground connection | +| VDD | 3V | Power supply (3.3V) | +| VDD3V | 3V | Power supply (3.3V) | +| MOSI | MOSI0 (Pin: 11) | SPI Data Out | +| MISO | MISO0 (Pin: 12) | SPI Data In | +| CLK | SCK0 (Pin: 13) | SPI Clock | +| CSn | CS0 (Pin: 10) | Chip select (configurable pin) | -**Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!** +**Warning: Ensure the sensor is powered with 3.3V to avoid damage to the Teensy board.** -#### Connect to a [Teensy 4.0](https://www.pjrc.com/store/teensy40.html) +#### Teensy 4.0 | AS5047P Pin | Teensy Pin | Comment | |:-----------:|:---------------:|:--------| -| GND | GND | - | -| VDD | 3V | - | -| VDD3V | 3V | - | -| MOSI | MOSI (Pin: 11) | - | -| MISO | MISO (Pin: 12) | - | -| CLK | SCK (Pin: 13) | - | -| CSn | CS (Pin: 10) | Can be any unused digital pin on the Teensy as long as it's configured here `AS5047P as5047p();` | +| GND | GND | Ground connection | +| VDD | 3V | Power supply (3.3V) | +| VDD3V | 3V | Power supply (3.3V) | +| MOSI | MOSI (Pin: 11) | SPI Data Out | +| MISO | MISO (Pin: 12) | SPI Data In | +| CLK | SCK (Pin: 13) | SPI Clock | +| CSn | CS (Pin: 10) | Chip select (configurable pin) | -**Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!** +**Warning: Ensure the sensor is powered with 3.3V to avoid damage to the Teensy board.** -#### Connect to a [Teensy 4.1](https://www.pjrc.com/store/teensy41.html) +#### Teensy 4.1 | AS5047P Pin | Teensy Pin | Comment | |:-----------:|:---------------:|:--------| -| GND | GND | - | -| VDD | 3V | - | -| VDD3V | 3V | - | -| MOSI | MOSI (Pin: 11) | - | -| MISO | MISO (Pin: 12) | - | -| CLK | SCK (Pin: 13) | - | -| CSn | CS (Pin: 10) | Can be any unused digital pin on the Teensy as long as it's configured here `AS5047P as5047p();` | +| GND | GND | Ground connection | +| VDD | 3V | Power supply (3.3V) | +| VDD3V | 3V | Power supply (3.3V) | +| MOSI | MOSI (Pin: 11) | SPI Data Out | +| MISO | MISO (Pin: 12) | SPI Data In | +| CLK | SCK (Pin: 13) | SPI Clock | +| CSn | CS (Pin: 10) | Chip select (configurable pin) | + +**Warning: Ensure the sensor is powered with 3.3V to avoid damage to the Teensy board.** + +## Usage Guide -**Please note that the sensor can no longer be operated with 5V, but must be operated with 3.3V, otherwise there is a risk of damaging the Teensy board!** +### Basic Example -## Project Status & ToDo's +The following example demonstrates how to read the angle from the AS5047P sensor using an Arduino board. + +```cpp +#include +#include + +AS5047P as5047p(9); // Chip select pin 9 + +void setup() { + Serial.begin(9600); + SPI.begin(); + as5047p.initSPI(); +} + +void loop() { + uint16_t angle = as5047p.readAngle(); + Serial.print("Angle: "); + Serial.println(angle); + delay(500); +} +``` + +### Advanced Usage + +The library provides several functions for advanced interaction with the sensor, including reading diagnostic registers and status flags. Refer to the [documentation](https://jonas-merkle.github.io/AS5047P/docs/master/html/index.html) for a complete API reference and usage examples. + +## License + +This project is licensed under the **GNU General Public License v3.0**. You can find the full license text in the [LICENSE](./LICENSE) file or visit the [GPL v3.0 License page](https://www.gnu.org/licenses/gpl-3.0.en.html) for more information. + +## Project Status & To-Do's | Status | Task / ToDo | |:------:|:------------| @@ -196,3 +260,4 @@ You can find this library [here](https://platformio.org/lib/show/12035/AS5047P) | ❌ | Additional examples. | | ❌ | Unit Tests?! | | ❌ | Implementation & test of programming the one-time programmable register of the AS5047P. | + From b42db63ab918fee4712351d67090e266b3e38279 Mon Sep 17 00:00:00 2001 From: "Jonas Merke [JJM]" Date: Sat, 19 Oct 2024 23:42:20 +0200 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=96=20Version=20No.=20changed=20to?= =?UTF-8?q?=202.2.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Doxyfile | 2 +- examples/BasicReadAngle/BasicReadAngle.ino | 6 +++--- .../BasicReadAngleAndDebugInfo.ino | 6 +++--- .../BasicReadAngleWithErrorInfo.ino | 6 +++--- examples/PrintAllSettings/PrintAllSettings.ino | 6 +++--- library.json | 2 +- library.properties | 2 +- src/AS5047P.cpp | 6 +++--- src/AS5047P.h | 6 +++--- src/spi/AS5047P_SPI_Arduino.cpp | 6 +++--- src/spi/AS5047P_SPI_Arduino.h | 6 +++--- src/types/AS5047P_Types.cpp | 6 +++--- src/types/AS5047P_Types.h | 6 +++--- src/util/AS5047P_Settings.h | 6 +++--- src/util/AS5047P_Util.h | 6 +++--- 15 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Doxyfile b/Doxyfile index ffec29f..c622bb5 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "AS5047P - Arduino Library" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 2.2.1 +PROJECT_NUMBER = 2.2.2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/examples/BasicReadAngle/BasicReadAngle.ino b/examples/BasicReadAngle/BasicReadAngle.ino index 5145ffa..0b95f89 100644 --- a/examples/BasicReadAngle/BasicReadAngle.ino +++ b/examples/BasicReadAngle/BasicReadAngle.ino @@ -3,10 +3,10 @@ * @author Jonas Merkle [JJM] (jonas@jjm.one) * @brief This is a basic example program to read the angle position from a AS5047 rotary encoder. * The angle postion gets updated and printed to the serial consol once a second. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * * More Information can be found here: * https://github.com/jonas-merkle/AS5047P diff --git a/examples/BasicReadAngleAndDebugInfo/BasicReadAngleAndDebugInfo.ino b/examples/BasicReadAngleAndDebugInfo/BasicReadAngleAndDebugInfo.ino index d5248b8..b390638 100644 --- a/examples/BasicReadAngleAndDebugInfo/BasicReadAngleAndDebugInfo.ino +++ b/examples/BasicReadAngleAndDebugInfo/BasicReadAngleAndDebugInfo.ino @@ -3,10 +3,10 @@ * @author Jonas Merkle [JJM] (jonas@jjm.one) * @brief This is a basic example program to read the angle position and debug information from a AS5047 rotary encoder. * The angle postion and debug information gets updated and printed to the serial consol once a second. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * * More Information can be found here: * https://github.com/jonas-merkle/AS5047P diff --git a/examples/BasicReadAngleWithErrorInfo/BasicReadAngleWithErrorInfo.ino b/examples/BasicReadAngleWithErrorInfo/BasicReadAngleWithErrorInfo.ino index 35a937f..fdf7393 100644 --- a/examples/BasicReadAngleWithErrorInfo/BasicReadAngleWithErrorInfo.ino +++ b/examples/BasicReadAngleWithErrorInfo/BasicReadAngleWithErrorInfo.ino @@ -4,10 +4,10 @@ * @brief This is a basic example program to read the angle position from a AS5047 rotary encoder. * The angle postion gets updated and printed to the serial consol once a second. * In addition to the angle value the error information gets displayed. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * * More Information can be found here: * https://github.com/jonas-merkle/AS5047P diff --git a/examples/PrintAllSettings/PrintAllSettings.ino b/examples/PrintAllSettings/PrintAllSettings.ino index 113ad78..465632e 100644 --- a/examples/PrintAllSettings/PrintAllSettings.ino +++ b/examples/PrintAllSettings/PrintAllSettings.ino @@ -2,10 +2,10 @@ * @file PrintAllSettings.ino * @author Jonas Merkle [JJM] (jonas@jjm.one) * @brief This is a example prints out the settings of the AS5047P sensor. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * * More Information can be found here: * https://github.com/jonas-merkle/AS5047P diff --git a/library.json b/library.json index 16ddc57..1450d78 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "AS5047P", - "version": "2.2.1", + "version": "2.2.2", "description": "An Arduino library for the AS5047P high-resolution rotary position sensor. Supporting also the following sensor types: AS5047D, AS5147, AS5147P, AS5247", "keywords": "arduino-library, as5047p, spi, sensor, rotary-encoder, high-resolution, rotary-position-sensor, as5x47, as5047d, as5147, as5147p, as5247, encoder, rotaty, angle, uvw, abi", "repository": diff --git a/library.properties b/library.properties index 53731e8..61b8075 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=AS5047P -version=2.2.1 +version=2.2.2 author=Jonas Merkle [JJM] maintainer=Jonas Merkle [JJM] sentence=An Arduino library for the AS5047P high-resolution rotary position sensor. diff --git a/src/AS5047P.cpp b/src/AS5047P.cpp index 93ab0af..5d774d0 100644 --- a/src/AS5047P.cpp +++ b/src/AS5047P.cpp @@ -2,10 +2,10 @@ * @file AS5047P.h * @author Jonas Merkle [JJM] (jonas@jjm.one) * @brief This is the main source file of the AS5047P Library. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * */ diff --git a/src/AS5047P.h b/src/AS5047P.h index 694fa40..1b7387f 100644 --- a/src/AS5047P.h +++ b/src/AS5047P.h @@ -2,10 +2,10 @@ * @file AS5047P.h * @author Jonas Merkle [JJM] (jonas@jjm.one) * @brief This is the main header file of the AS5047P Library. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * */ diff --git a/src/spi/AS5047P_SPI_Arduino.cpp b/src/spi/AS5047P_SPI_Arduino.cpp index 6b04dc7..a560be4 100644 --- a/src/spi/AS5047P_SPI_Arduino.cpp +++ b/src/spi/AS5047P_SPI_Arduino.cpp @@ -4,10 +4,10 @@ * @file AS5047P_SPI_Arduino.cpp * @author Jonas Merkle [JJM] (jonas@jjm.one) * @brief This soure file contains the implementation of the Arduino SPI bus handler for the AS5047P Library. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * */ diff --git a/src/spi/AS5047P_SPI_Arduino.h b/src/spi/AS5047P_SPI_Arduino.h index cdfd0b3..d97c1dd 100644 --- a/src/spi/AS5047P_SPI_Arduino.h +++ b/src/spi/AS5047P_SPI_Arduino.h @@ -2,10 +2,10 @@ * @file AS5047P_SPI_Arduino.h * @author Jonas Merkle [JJM] (jonas@jjm.one) * @brief This header file contains the Arduino SPI bus handler for the AS5047P Library. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * */ diff --git a/src/types/AS5047P_Types.cpp b/src/types/AS5047P_Types.cpp index be3379f..e7017d7 100644 --- a/src/types/AS5047P_Types.cpp +++ b/src/types/AS5047P_Types.cpp @@ -2,10 +2,10 @@ * @file AS5047P_Types.cpp * @author Jonas Merkle [JJM] (jonas@jjm.one) * @brief This source file contains the implementation of the type definitions for the AS5047P Library. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * */ diff --git a/src/types/AS5047P_Types.h b/src/types/AS5047P_Types.h index 56e87e9..4d86692 100644 --- a/src/types/AS5047P_Types.h +++ b/src/types/AS5047P_Types.h @@ -2,10 +2,10 @@ * @file AS5047P_Types.h * @author Jonas Merkle [JJM] (jonas@jjm.one) * @brief This header file contains type definitions for the AS5047P Library. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * */ diff --git a/src/util/AS5047P_Settings.h b/src/util/AS5047P_Settings.h index b662664..d541d6b 100644 --- a/src/util/AS5047P_Settings.h +++ b/src/util/AS5047P_Settings.h @@ -2,10 +2,10 @@ * @file AS5047P_Settings.h * @author Jonas Merkle [JJM] (jonas@jjm.one) * @brief This header file contains settings information for the AS5047P Library. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * */ diff --git a/src/util/AS5047P_Util.h b/src/util/AS5047P_Util.h index 8276a20..01b7470 100644 --- a/src/util/AS5047P_Util.h +++ b/src/util/AS5047P_Util.h @@ -2,10 +2,10 @@ * @file AS5047P_Util.h * @author Jonas Merkle [JJM] (jonas@jjm.one) * @brief This header file contains util functions for the AS5047P Library. - * @version 2.2.1 - * @date 2023-07-04 + * @version 2.2.2 + * @date 2024-10-19 * - * @copyright Copyright (c) 2023 Jonas Merkle. This project is released under the GPL-3.0 License License. + * @copyright Copyright (c) 2024 Jonas Merkle. This project is released under the GPL-3.0 License License. * */