-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathPreciseMagneticSensorAS5048A.h
More file actions
33 lines (26 loc) · 1.03 KB
/
PreciseMagneticSensorAS5048A.h
File metadata and controls
33 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* PreciseMagneticSensorAS5048A.h
*
* Created on: 1 May 2021
* Author: runger
*/
#ifndef LIBRARIES_ARDUNIO_FOC_DRIVERS_SRC_ENCODERS_AS5048A_PRECISEMAGNETICSENSORAS5048A_H_
#define LIBRARIES_ARDUNIO_FOC_DRIVERS_SRC_ENCODERS_AS5048A_PRECISEMAGNETICSENSORAS5048A_H_
#include "common/base_classes/Sensor.h"
#include "./AS5048A.h"
#include "utilities/PreciseAngle.h"
class PreciseMagneticSensorAS5048A : public Sensor, public AS5048A {
public:
PreciseMagneticSensorAS5048A(int nCS = -1, bool fastMode = false, SPISettings settings = AS5048SPISettings);
virtual ~PreciseMagneticSensorAS5048A();
virtual float getSensorAngle() override;
virtual float getVelocity() override;
virtual void init(SPIClass* _spi = &SPI) override;
protected:
bool fastMode = false;
PreciseAngle previous_angle = PreciseAngle();
PreciseAngle current_angle = PreciseAngle();
unsigned long previous_ts = 0;
unsigned long current_ts = 1;
};
#endif /* LIBRARIES_ARDUNIO_FOC_DRIVERS_SRC_ENCODERS_AS5048A_PRECISEMAGNETICSENSORAS5048A_H_ */