summaryrefslogtreecommitdiff
path: root/itg3200.h
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2011-11-19 20:02:14 +0100
committerVegard Storheil Eriksen <zyp@jvnv.net>2011-11-19 20:02:14 +0100
commit307cfe164910eccc70c086c083595d637c7fb987 (patch)
treef9845dc9647518840faf469580f581cf65d9fced /itg3200.h
parentc265553652444293f90189c7481fb7eb16f28115 (diff)
Moved driver related files to a subdirectory.
Diffstat (limited to 'itg3200.h')
-rw-r--r--itg3200.h32
1 files changed, 0 insertions, 32 deletions
diff --git a/itg3200.h b/itg3200.h
deleted file mode 100644
index 2e90f62..0000000
--- a/itg3200.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef ITG3200_H
-#define ITG3200_H
-
-#include "i2c.h"
-
-class ITG3200 {
- private:
- I2C& i2c;
-
- public:
- int16_t x, y, z;
-
- ITG3200(I2C& i2c_bus) : i2c(i2c_bus) {
-
- }
-
- void init() {
- i2c.write_reg(0x68, 0x3e, 0x03); // Select clock reference.
- i2c.write_reg(0x68, 0x16, 0x18 | 0x02); // 2000 deg/sec range, 98 Hz bandwidth.
- }
-
- void update() {
- uint8_t buf[6];
- i2c.read_reg(0x68, 0x1d, 6, buf);
-
- x = (buf[0] << 8 | buf[1]) - 0;
- y = (buf[2] << 8 | buf[3]) - 0;
- z = (buf[4] << 8 | buf[5]) - 0;
- }
-};
-
-#endif