GithubHelp home page GithubHelp logo

eborghi10 / as5048a Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 9.0 18 KB

A simple SPI library to interface with Austria Microsystem's AS5048A angle sensor

Home Page: https://github.com/ZoetropeLabs/AS5048A-Arduino

License: MIT License

C++ 100.00%
as4058 magnetic-sensor ams arduino

as5048a's Introduction

AS5048A Arduino library

A simple SPI library to interface with Austria Microsystem's AS5048A angle sensor with an Arduino or an ESP32.

The sensor should be connected to the hardware SPI pins (MISO, MOSI, SCK). The CS pin can be connected to any GPIO pin but should be passed to the constructor.


Original author: ZoetropeLabs

as5048a's People

Contributors

eborghi10 avatar maalaie avatar oschwartz10612 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

as5048a's Issues

Errors: Read (0x1) with command: 0b100000000000001

Hello again,

Apologies for bothering you again. I am new to this sensor so I am learning as I go.

I have the following simple code to read the sensor and send it over serial on an ESP32.

        uint16_t val = encoder.getRawRotation();
        Serial.print("Got rotation of: 0x");
        Serial.println(val, HEX);
        Serial.print("State: ");
        encoder.printState();
        Serial.print("Errors: ");
        Serial.println(encoder.getErrors());

Unfortunately I seem to get an error and no rotation reading.

Read (0x3FFF) with command: 0b1111111111111111
Read returned: 1111111111111111
Got rotation of: 0x0
State: Read (0x3FFD) with command: 0b111111111111101
Read returned: 111111111111101
0
Errors: Read (0x1) with command: 0b100000000000001
Read returned: 100000000000001

Any insight would be appreciated.

How to set zero position?

Hello,
I am using the As5048a sensor for a project in order to measure the angle of attack of an airplane. For the connection, I use an Arduino Nano.This code works really well, but I have difficulties on setting zero position. Do you have any idea? Thanks in advance

Compile Errors ESP32

Hi,

I am trying to use your library for the esp support with an ESP32 and the AS5048A. When I compile using platformio, I get the following errors:

In file included from lib/AS5048A/AS5048A.cpp:3:0:
lib/AS5048A/AS5048A.h: In constructor 'AS5048A::AS5048A(byte, bool)':
lib/AS5048A/AS5048A.h:11:10: error: 'AS5048A::_cs' will be initialized after [-Werror=reorder]
  uint8_t _cs;
          ^
lib/AS5048A/AS5048A.h:9:7: error:   'bool AS5048A::errorFlag' [-Werror=reorder]
  bool errorFlag;
       ^
lib/AS5048A/AS5048A.cpp:28:1: error:   when initialized here [-Werror=reorder]
 AS5048A::AS5048A(byte cs, bool debug /*=false*/)
 ^
In file included from lib/AS5048A/AS5048A.cpp:3:0:
lib/AS5048A/AS5048A.h:12:11: error: 'AS5048A::position' will be initialized after [-Werror=reorder]
  uint16_t position;
           ^
lib/AS5048A/AS5048A.h:8:7: error:   'bool AS5048A::debug' [-Werror=reorder]
  bool debug;
       ^
lib/AS5048A/AS5048A.cpp:28:1: error:   when initialized here [-Werror=reorder]
 AS5048A::AS5048A(byte cs, bool debug /*=false*/)
 ^
cc1plus: some warnings being treated as errors
*** [.pio/build/featheresp32/lib360/AS5048A/AS5048A.cpp.o] Error 1

Any idea what the issue is here?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.