got angle sensor reading

This commit is contained in:
Nicolas Trimborn
2021-07-26 23:20:00 +02:00
parent 312768d2cf
commit 128dbfe5c3
18 changed files with 1825 additions and 442 deletions

View File

@@ -0,0 +1,21 @@
#include <AS5048A.h>
AS5048A angleSensor(SS, false);
void setup()
{
Serial.begin(19200);
angleSensor.begin();
}
void loop()
{
delay(100);
float val = angleSensor.getRotationInDegrees();
Serial.print("\nGot rotation of: ");
Serial.println(val);
Serial.print("State: ");
angleSensor.printState();
Serial.print("Errors: ");
Serial.println(angleSensor.getErrors());
}