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.
Dependencies: mbed
Fork of 2014_12_12_quadro_01 by
Diff: IMU.cpp
- Revision:
- 10:2794020bfc0c
- Parent:
- 8:7a22b8294c5d
--- a/IMU.cpp Mon Dec 08 13:28:17 2014 +0000
+++ b/IMU.cpp Fri Dec 12 10:15:10 2014 +0000
@@ -65,8 +65,9 @@
ack |= _i2c.write(address, tx, 1);
ack |= _i2c.read(address+1, &rx, 1); if (rx != 0x77) ack |= 1;
tx[0] = LSM303_A_CTRL_REG4;
- //tx[1] = 0x08; // 0000 1000 enable high resolution mode + selects default 2G scale. p.26/42
- tx[1] = 0x18; // 0001 1000 enable high resolution mode + selects 4G scale.
+ tx[1] = 0x08; // 0000 1000 enable high resolution mode + selects default 2G scale. p.26/42
+ //tx[1] = 0x18; // 0001 1000 enable high resolution mode + selects 4G scale.
+ //tx[1]= 0x38; //0011 1000 high resolution +-16G
ack |= _i2c.write(address, tx ,2);
ack |= _i2c.write(address, tx, 1);
ack |= _i2c.read(address+1, &rx, 1); if (rx != 0x18) ack |= 1;
@@ -99,8 +100,9 @@
L3GD20_biasZ = (int16_t) 140; //BYLO -10
/* reference gravity acceleration */
- //g_0 = 9.815; //przy ustawieniu zakresu na +/- 2g
- g_0 = 19.63; //przy ustawienu zakresu na +/- 4g // CTR_REG 4 = 0001 1000 0x18
+ g_0 = 9.815; //przy ustawieniu zakresu na +/- 2g
+ //g_0 = 19.63; //przy ustawienu zakresu na +/- 4g // CTR_REG 4 = 0001 1000 0x18
+ //g_0 = 78.52; //przy ustawieniu zakresu na +/- 16g //...
/* filter parameters: assume 400 Hz sampling rare and 2nd orcer Butterworth filter with fc = 5Hz. */
pi = 3.1415926536;
