3Axis gyro sensor sample. target sensor: L3GD20(ST)

Dependencies:   mbed

Committer:
satoshi1204
Date:
Mon Dec 17 12:47:04 2018 +0000
Revision:
0:a1d1374eea97
Child:
1:191e963655c2
Implementation sample program for gyro sensor L3GD20

Who changed what in which revision?

UserRevisionLine numberNew 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 0:a1d1374eea97 12 char readByte(char reg);
satoshi1204 0:a1d1374eea97 13 void writeByte(char reg, char data);
satoshi1204 0:a1d1374eea97 14 };