https://github.com/yasir-shahzad/ams-as5048b
Linux Liberary for AMS AS5048B I2C - 14-bit magnetic rotary position sensor
https://github.com/yasir-shahzad/ams-as5048b
angle as5048 i2c linux magnetic radian-angle rotary-encoder
Last synced: 6 months ago
JSON representation
Linux Liberary for AMS AS5048B I2C - 14-bit magnetic rotary position sensor
- Host: GitHub
- URL: https://github.com/yasir-shahzad/ams-as5048b
- Owner: yasir-shahzad
- License: gpl-3.0
- Created: 2022-11-17T08:31:51.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2025-03-18T09:51:47.000Z (7 months ago)
- Last Synced: 2025-03-18T10:38:47.897Z (7 months ago)
- Topics: angle, as5048, i2c, linux, magnetic, radian-angle, rotary-encoder
- Language: C++
- Homepage:
- Size: 37.1 KB
- Stars: 31
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Linux Library for AMS AS5048B
[](https://github.com/oliexdev/openScale/actions/workflows/ci.yml)
[](https://hosted.weblate.org/engage/openscale/?utm_source=widget)## Overview
This repository provides a **Linux library** for interfacing with the **AMS AS5048B**, a **14-bit I2C magnetic rotary position sensor**. The AS5048B is designed for high-precision **angle measurement** applications, making it ideal for robotics, automation, motor control, and other **position-sensing** needs.---
## Features 🚀
✅ **14-bit High-Resolution** – Accurate angular position sensing.
✅ **I2C Interface** – Communicates seamlessly with Linux-based systems.
✅ **360° Absolute Positioning** – No need for an external reference.
✅ **Configurable Zero Position** – Supports offset correction for custom applications.
✅ **Error Detection** – Built-in diagnostic features to detect failures.---
## Installation 🛠️
Clone the repository and install dependencies:
```bash
git clone https://github.com/yasir-shahzad/AS5048B-Library.git
cd AS5048B-Library
make
sudo make install
```---
## Usage 📖
Example code to read the angle from AS5048B:
```cpp
#include "AS5048B.h"AS5048B sensor(0x40); // I2C address
int main() {
sensor.begin();
float angle = sensor.getAngle();
printf("Current Angle: %.2f°\n", angle);
return 0;
}
```---
## Applications 🔄
- **Robotics & Automation** 🤖
- **Motor Position Control** ⚙️
- **Industrial Motion Tracking** 🏭
- **Gimbal & Camera Stabilization** 🎥
- **Aerospace & Defense** ✈️---
## License 📜
This project is licensed under **GPL v3**, ensuring open-source collaboration and improvements.💡 **Contributions Welcome!** If you’d like to improve this library, feel free to submit a **pull request** or report **issues**. 🎯