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.
β
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.
Clone the repository and install dependencies:
git clone https://github.com/yasir-shahzad/AS5048B-Library.git
cd AS5048B-Library
make
sudo make install
Example code to read the angle from AS5048B:
#include "AS5048B.h"
AS5048B sensor(0x40); // I2C address
int main() {
sensor.begin();
float angle = sensor.getAngle();
printf("Current Angle: %.2fΒ°\n", angle);
return 0;
}
- Robotics & Automation π€
- Motor Position Control βοΈ
- Industrial Motion Tracking π
- Gimbal & Camera Stabilization π₯
- Aerospace & Defense
βοΈ
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. π―