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.
Diff: QMC5883L.cpp
- Revision:
- 1:40133ee060bb
- Parent:
- 0:1d7c885bfcc6
- Child:
- 2:146db5bc0fee
--- a/QMC5883L.cpp Sat Jan 26 21:39:07 2019 +0000
+++ b/QMC5883L.cpp Sat Jan 26 22:38:25 2019 +0000
@@ -29,12 +29,12 @@
switch(range)
{
case 2:
- range_data = 0x00;
- mRes = 1.0/12000;
+ range_data = 0x00; //vrijednost pomocu koje se ostvaruje 2G
+ mRes = 1.0/12000; //rezolucija pri 2G
break;
case 8:
- range_data = 0x01;
- mRes = 1.0/3000;
+ range_data = 0x10; //vrijednost pomocu koje se ostvaruje 8G
+ mRes = 1.0/3000; //rezolucija pri 8G
break;
}
}
@@ -42,8 +42,8 @@
void QMC5883L::init()
{
- QMC5883L_w (CONTROL_A, 0x0D | range_data); //
- QMC5883L_w (SET_RESET, 0x01);
+ QMC5883L_w (CONTROL_A, 0x0D | range_data); // postavljanje 2G ili 8G, te namještanje opcija OSR, ODR i MODE - 8G, 200 Hz , continous measurment
+ QMC5883L_w (SET_RESET, 0x01); // datasheet It is recommended that the register 0BH is written by 0x01.
wait_ms(10);
}
@@ -84,7 +84,7 @@
eLSB = QMC5883L_r(TEMP_LSB); // očitaj LSB temp
eMSB = QMC5883L_r(TEMP_MSB); // očitaj MSB temp
temp_data = ((eMSB<<8) | eLSB);
- Temp_temp = (temp_data /100.0)+ 40; // relativna temp + sobna
+ Temp_temp = (temp_data /100.0)+ 40; // relativna temp + offset
return Temp_temp;
}