File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ int MagneticSensorI2C::read(uint8_t angle_reg_msb) {
9595 // notify the device that is aboout to be read
9696 wire->beginTransmission (chip_address);
9797 wire->write (angle_reg_msb);
98- wire->endTransmission (false );
98+ currWireError = wire->endTransmission (false );
9999
100100 // read the data msb and lsb
101101 wire->requestFrom (chip_address, (uint8_t )2 );
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ class MagneticSensorI2C: public Sensor{
5151 /* * experimental function to check and fix SDA locked LOW issues */
5252 int checkBus (byte sda_pin , byte scl_pin );
5353
54+ /* * current error code from Wire endTransmission() call **/
55+ uint8_t currWireError = 0 ;
56+
5457 private:
5558 float cpr; // !< Maximum range of the magnetic sensor
5659 uint16_t lsb_used; // !< Number of bits used in LSB register
You can’t perform that action at this time.
0 commit comments