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.
Fork of 6DoF_IMU_readvalue by
Revision 1:c85175226571, committed 2013-02-12
- Comitter:
- Vigneshwar
- Date:
- Tue Feb 12 02:31:21 2013 +0000
- Parent:
- 0:cda6d9f5a43c
- Child:
- 2:39468ef68358
- Commit message:
- Final Version
Changed in this revision
| ITG3200.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ITG3200.lib Mon Nov 26 05:34:56 2012 +0000 +++ b/ITG3200.lib Tue Feb 12 02:31:21 2013 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/aberk/code/ITG3200/#b098d99dd81e +http://mbed.org/users/Digixx/code/ITG3200/#8967cbe04d96
--- a/main.cpp Mon Nov 26 05:34:56 2012 +0000
+++ b/main.cpp Tue Feb 12 02:31:21 2013 +0000
@@ -2,15 +2,17 @@
#include "ADXL345_I2C.h"
Serial pc(USBTX, USBRX);
-ITG3200 gyro(p9, p10);
-ADXL345_I2C accel(p9, p10);
+ITG3200 gyro(p28, p27);
+ADXL345_I2C accel(p28, p27);
int main() {
+ char str[512];
gyro.setWhoAmI(0x68);
pc.printf("Now starting 6-degrees-of-freedom (ITG-3200 ADXL345) test...\n");
pc.printf("Accelerometer Device ID is: 0x%02x\n", accel.getDeviceID());
- pc.printf("Gyro Devide ID is: 0x02x\n", gyro.getWhoAmI());
-
+ pc.printf("Gyro Devide ID is: 0x%02x\n", gyro.getWhoAmI());
+
+
int accel_read[3] = {0, 0, 0};
// Accel setup
@@ -42,14 +44,21 @@
// Gyro setup
gyro.setLpBandwidth(LPFBW_42HZ);
- while (1) {
+ while (1)
+ {
wait(0.1);
accel.getOutput(accel_read);
- pc.printf("Gyro[%5i, %5i, %5i] Accel[%4i, %4i, %4i]\n",
+ sprintf(str, "%i,%i,%i,%i,%i,%i,%i\n", (int16_t)accel_read[0], (int16_t)accel_read[1], (int16_t)accel_read[2],
+ gyro.getGyroX(), gyro.getGyroY(), gyro.getGyroZ(), (int16_t)gyro.getTemperature());
+ pc.printf(str);
+
+ /*
+ pc.printf("Gyro[%5i, %5i, %5i] Accel[%4i, %4i, %4i]\n\t",
gyro.getGyroX(), gyro.getGyroY(), gyro.getGyroZ(),
(int16_t)accel_read[0], (int16_t)accel_read[1], (int16_t)accel_read[2]);
+ */
}
}
