diff --git a/source/drivers/MAG3110.cpp b/source/drivers/MAG3110.cpp index 8bc18fd..5a107a3 100644 --- a/source/drivers/MAG3110.cpp +++ b/source/drivers/MAG3110.cpp @@ -99,7 +99,7 @@ int MAG3110::configure() // Bring the device online, with the requested sample frequency. - result = i2c.writeRegister(address, MAG_CTRL_REG1, magnetometerPeriod.get(samplePeriod) | 0x01); + result = i2c.writeRegister(address, MAG_CTRL_REG1, magnetometerPeriod.get(samplePeriod * 1000) | 0x01); if (result != MICROBIT_OK) return MICROBIT_I2C_ERROR; diff --git a/source/drivers/MMA8653.cpp b/source/drivers/MMA8653.cpp index 8195fc4..b1e5bcc 100644 --- a/source/drivers/MMA8653.cpp +++ b/source/drivers/MMA8653.cpp @@ -130,7 +130,7 @@ int MMA8653::configure() return MICROBIT_I2C_ERROR; // Bring the device back online, with 10bit wide samples at the requested frequency. - value = accelerometerPeriod.get(samplePeriod); + value = accelerometerPeriod.get(samplePeriod * 1000); result = i2c.writeRegister(address, MMA8653_CTRL_REG1, value | 0x01); if (result != 0) return MICROBIT_I2C_ERROR; diff --git a/source/drivers/MicroBitCompass.cpp b/source/drivers/MicroBitCompass.cpp index 16c08e5..8fee178 100644 --- a/source/drivers/MicroBitCompass.cpp +++ b/source/drivers/MicroBitCompass.cpp @@ -79,8 +79,8 @@ void MicroBitCompass::init(uint16_t id) this->id = id; this->status = 0; - // Set a default rate of 50Hz. - this->samplePeriod = 20; + // Set a default rate of 10Hz. + this->samplePeriod = 100; this->configure(); // Assume that we have no calibration information.