got angle sensor reading
This commit is contained in:
21
Examples/Arduino/esp32_angle_sensor/esp32_angle_sensor.ino
Normal file
21
Examples/Arduino/esp32_angle_sensor/esp32_angle_sensor.ino
Normal 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());
|
||||
}
|
||||
Reference in New Issue
Block a user