![]() |
SimpleFOClibrary
2.1
|
#include <MagneticSensorAnalog.h>
Public Member Functions | |
MagneticSensorAnalog (uint8_t _pinAnalog, int _min=0, int _max=0) | |
void | init () |
float | getAngle () override |
float | getVelocity () override |
![]() | |
virtual int | needsSearch () |
Public Attributes | |
int | pinAnalog |
encoder hardware pin A More... | |
Pullup | pullup |
This sensor has been tested with AS5600 running in 'analog mode'. This is where output pin of AS6000 is connected to an analog pin on your microcontroller. This approach is very simple but you may more accurate results with MagneticSensorI2C if that is also supported as its skips the DAC -> ADC conversion (ADC supports MagneticSensorI2C)
Definition at line 13 of file MagneticSensorAnalog.h.
MagneticSensorAnalog::MagneticSensorAnalog | ( | uint8_t | _pinAnalog, |
int | _min_raw_count = 0 , |
||
int | _max_raw_count = 0 |
||
) |
MagneticSensorAnalog class constructor
_pinAnalog | the pin to read the PWM signal |
MagneticSensorAnalog(uint8_t _pinAnalog, int _min, int _max)
_pinAnalog | the pin that is reading the pwm from magnetic sensor |
_min_raw_count | the smallest expected reading. Whilst you might expect it to be 0 it is often ~15. Getting this wrong results in a small click once per revolution |
_max_raw_count | the largest value read. whilst you might expect it to be 2^10 = 1023 it is often ~ 1020. Note: For ESP32 (with 12bit ADC the value will be nearer 4096) |
Definition at line 8 of file MagneticSensorAnalog.cpp.
|
overridevirtual |
|
overridevirtual |
get current angular velocity (rad/s)
Reimplemented from Sensor.
Definition at line 64 of file MagneticSensorAnalog.cpp.
void MagneticSensorAnalog::init | ( | ) |
sensor initialise pins
Definition at line 25 of file MagneticSensorAnalog.cpp.
int MagneticSensorAnalog::pinAnalog |
encoder hardware pin A
Definition at line 25 of file MagneticSensorAnalog.h.
Pullup MagneticSensorAnalog::pullup |
Definition at line 28 of file MagneticSensorAnalog.h.