Skip to content

Arduino library for the Austria Micro Systems AS5048A/... angle position sensor.

License

Notifications You must be signed in to change notification settings

107-systems/107-Arduino-AS504x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

107-Arduino-AS504x

Arduino Library Badge Compile Examples Check Arduino Check keywords.txt General Formatting Checks Spell Check

Arduino library for interfacing with various Austria Micro Systems angle position sensors.

This library works for

Example

#include <107-Arduino-AS504x.h>
/* ... */
static SPISettings const AS504x_SPI_SETTING{1000000, MSBFIRST, SPI_MODE1};
/* ... */
ArduinoAS504x angle_pos_sensor([](){ SPI.beginTransaction(AS504x_SPI_SETTING); },
                               [](){ SPI.endTransaction(); },
                               [](){ digitalWrite(AS504x_CS_PIN, LOW); },
                               [](){ digitalWrite(AS504x_CS_PIN, HIGH); },
                               [](uint8_t const d) -> uint8_t { return SPI.transfer(d); },
                               delayMicroseconds);
/* ... */
void setup()
{
  SPI.begin();
  pinMode(AS504x_CS_PIN, OUTPUT);
  digitalWrite(AS504x_CS_PIN, HIGH);
}

void loop()
{
  char msg[64] = {0};
  snprintf(msg, sizeof(msg), "Angle (Raw) = %d", angle_pos_sensor.angle_raw());
  Serial.println(msg);
  delay(100);
}

Hardware

Breakout/Development-Board

Colour Nano RP2040 Pin AS5048A-TS_EK_AB Pin
Red 3.3V 3.3V
Black GND GND
Green (1) CIPO MISO
Yellow COPI MOSI
Blue SCK SCK
Green (2) D2 CSn

About

Arduino library for the Austria Micro Systems AS5048A/... angle position sensor.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages