![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
3Axis gyro sensor sample. target sensor: L3GD20(ST)
main.cpp
- Committer:
- satoshi1204
- Date:
- 2018-12-17
- Revision:
- 0:a1d1374eea97
File content as of revision 0:a1d1374eea97:
#include "mbed.h" #include "L3GD20.h" DigitalOut myled(LED1); Serial pc(USBTX, USBRX); L3GD20 gyro(p9, p10); int main() { while(1) { myled = 1; wait(0.2); double x, y, z; gyro.readData(x, y, z); pc.printf("%5.4lf %5.4lf %5.4lf\r\n", x, y, z); myled = 0; wait(0.2); } }