diff --git a/inc/drivers/MicroBitCompass.h b/inc/drivers/MicroBitCompass.h index f82e26f..0f4527e 100644 --- a/inc/drivers/MicroBitCompass.h +++ b/inc/drivers/MicroBitCompass.h @@ -196,7 +196,7 @@ class MicroBitCompass : public MicroBitComponent * * @return MICROBIT_OK on success, MICROBIT_I2C_ERROR if the compass could not be configured. */ - int configure(); + virtual int configure(); /** * diff --git a/source/drivers/LSM303Magnetometer.cpp b/source/drivers/LSM303Magnetometer.cpp index abd0c83..d67b873 100644 --- a/source/drivers/LSM303Magnetometer.cpp +++ b/source/drivers/LSM303Magnetometer.cpp @@ -68,7 +68,7 @@ int LSM303Magnetometer::configure() return MICROBIT_I2C_ERROR; // Enable Data Ready interrupt, with buffering of data to avoid race conditions. - result = i2c.writeRegister(address, LSM303_CFG_REG_C_M, 0x41); + result = i2c.writeRegister(address, LSM303_CFG_REG_C_M, 0x01); if (result != MICROBIT_OK) return MICROBIT_I2C_ERROR; @@ -115,7 +115,7 @@ int LSM303Magnetometer::requestUpdate() } // Poll interrupt line from device (ACTIVE LO) - if(!int1.getDigitalValue()) + if(int1.getDigitalValue()) { uint8_t data[6]; int result;