![]() ![]() ![]() To instantiate the I2C magnetic sensor you need to provide the MSB register address and tell the library how is the angle value separated in the two registers. How to find the MSB register values and used bits value?Since I2C registers are Byte(8-bit) registers they contain the 12-14 bit angle representation separated in two Byte addresses, MSB(most significant byte) and LSB(least significant byte). bits_used_msb - number of used bits in MSB register.angle_register_msb - register number containing the MSB part of the angle value.bit_resolution - resolution of your sensor (number of bits of the sensor internal counter register) and your.chip_address - I2C address of the magnetic sensor.MagneticSensorI2C(uint8_t _chip_address, float _cpr, uint8_t _angle_register_msb) // chip_address - I2C chip address // bit_resolution - resolution of the sensor // angle_register_msb - angle read register msb // bits_used_msb - number of used bits in msb register MagneticSensorI2C sensor = MagneticSensorI2C ( 0x36, 12, 0x0E, 4 )
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |