SimpleFOClibrary  2.1
MagneticSensorI2C Class Reference

#include <MagneticSensorI2C.h>

Inheritance diagram for MagneticSensorI2C:
Sensor

Public Member Functions

 MagneticSensorI2C (uint8_t _chip_address, int _bit_resolution, uint8_t _angle_register_msb, int _msb_bits_used)
 
 MagneticSensorI2C (MagneticSensorI2CConfig_s config)
 
void init (TwoWire *_wire=&Wire)
 
float getAngle () override
 
float getVelocity () override
 
int checkBus (byte sda_pin=SDA, byte scl_pin=SCL)
 
- Public Member Functions inherited from Sensor
virtual int needsSearch ()
 

Static Public Member Functions

static MagneticSensorI2C AS5600 ()
 

Detailed Description

Definition at line 19 of file MagneticSensorI2C.h.

Constructor & Destructor Documentation

◆ MagneticSensorI2C() [1/2]

MagneticSensorI2C::MagneticSensorI2C ( uint8_t  _chip_address,
int  _bit_resolution,
uint8_t  _angle_register_msb,
int  _msb_bits_used 
)

MagneticSensorI2C class constructor

Parameters
chip_addressI2C chip address
bitsnumber of bits of the sensor resolution
angle_register_msbangle read register msb
_bits_used_msbnumber of used bits in msb

Definition at line 25 of file MagneticSensorI2C.cpp.

◆ MagneticSensorI2C() [2/2]

MagneticSensorI2C::MagneticSensorI2C ( MagneticSensorI2CConfig_s  config)

MagneticSensorI2C class constructor

Parameters
configI2C config

Definition at line 45 of file MagneticSensorI2C.cpp.

Member Function Documentation

◆ AS5600()

static MagneticSensorI2C MagneticSensorI2C::AS5600 ( )
static

◆ checkBus()

int MagneticSensorI2C::checkBus ( byte  sda_pin = SDA,
byte  scl_pin = SCL 
)

experimental function to check and fix SDA locked LOW issues

Definition at line 159 of file MagneticSensorI2C.cpp.

◆ getAngle()

float MagneticSensorI2C::getAngle ( )
overridevirtual

get current angle (rad)

Implements Sensor.

Definition at line 79 of file MagneticSensorI2C.cpp.

◆ getVelocity()

float MagneticSensorI2C::getVelocity ( )
overridevirtual

get current angular velocity (rad/s)

Reimplemented from Sensor.

Definition at line 98 of file MagneticSensorI2C.cpp.

◆ init()

void MagneticSensorI2C::init ( TwoWire *  _wire = &Wire)

sensor initialise pins

Definition at line 61 of file MagneticSensorI2C.cpp.


The documentation for this class was generated from the following files: