Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:20caae52ae0e, committed 2016-05-23
- Comitter:
- c0112463
- Date:
- Mon May 23 00:17:06 2016 +0000
- Parent:
- 0:f1b56c26e351
- Commit message:
- 20160523
Changed in this revision
HMC5883L.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/HMC5883L.cpp Fri May 20 06:43:25 2016 +0000 +++ b/HMC5883L.cpp Mon May 23 00:17:06 2016 +0000 @@ -61,36 +61,12 @@ //各軸の値を取得する float HMC5883L::getGeomagX(){ return ((float)hmc5883l_data[0]*gain); - /* - char tx = HMC5883L_DATAXM_REG; - char rx[2]; - i2c_.write(HMC5883L_I2C_ADDRESS,&tx,1); - i2c_.write(HMC5883L_I2C_ADDRESS|0x01,rx,2); - int16_t output = ((int) rx[0] << 8) | ((int) rx[1]); - return ((float)output*gain); - */ } float HMC5883L::getGeomagY(){ return ((float)hmc5883l_data[2]*gain); - /* - char tx = HMC5883L_DATAYM_REG; - char rx[2]; - i2c_.write(HMC5883L_I2C_ADDRESS,&tx,1); - i2c_.write(HMC5883L_I2C_ADDRESS|0x01,rx,2); - int16_t output = ((int) rx[0] << 8) | ((int) rx[1]); - return ((float)output*gain); - */ } float HMC5883L::getGeomagZ(){ return ((float)hmc5883l_data[1]*gain); - /* - char tx = HMC5883L_DATAZM_REG; - char rx[2]; - i2c_.write(HMC5883L_I2C_ADDRESS,&tx,1); - i2c_.write(HMC5883L_I2C_ADDRESS|0x01,rx,2); - int16_t output = ((int) rx[0] << 8) | ((int) rx[1]); - return ((float)output*gain); - */ } //オフセットの値を取得する float HMC5883L::getOffsetX(){