![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
3Axis gyro sensor sample. target sensor: L3GD20(ST)
L3GD20.h@1:191e963655c2, 2018-12-18 (annotated)
- Committer:
- satoshi1204
- Date:
- Tue Dec 18 09:08:07 2018 +0000
- Revision:
- 1:191e963655c2
- Parent:
- 0:a1d1374eea97
3Axis gyro sensor sample
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
satoshi1204 | 0:a1d1374eea97 | 1 | #include "mbed.h" |
satoshi1204 | 0:a1d1374eea97 | 2 | |
satoshi1204 | 0:a1d1374eea97 | 3 | class L3GD20 |
satoshi1204 | 0:a1d1374eea97 | 4 | { |
satoshi1204 | 0:a1d1374eea97 | 5 | public: |
satoshi1204 | 0:a1d1374eea97 | 6 | L3GD20(PinName sda, PinName scl); |
satoshi1204 | 0:a1d1374eea97 | 7 | ~L3GD20(); |
satoshi1204 | 0:a1d1374eea97 | 8 | void readData(double &x, double &y, double &z); |
satoshi1204 | 0:a1d1374eea97 | 9 | private: |
satoshi1204 | 0:a1d1374eea97 | 10 | I2C i2c; |
satoshi1204 | 0:a1d1374eea97 | 11 | unsigned char address; |
satoshi1204 | 1:191e963655c2 | 12 | void turnOn(void); |
satoshi1204 | 0:a1d1374eea97 | 13 | char readByte(char reg); |
satoshi1204 | 0:a1d1374eea97 | 14 | void writeByte(char reg, char data); |
satoshi1204 | 0:a1d1374eea97 | 15 | }; |