![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
reads gyroscope values
Diff: main.cpp
- Revision:
- 0:637603e82d47
diff -r 000000000000 -r 637603e82d47 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Sep 18 16:08:39 2015 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "L3GD20.h" + +Serial pc(USBTX, USBRX); +L3GD20 gyro(p28, p27); +float gx; +float gy; +float gz; +int x; + +int main() +{ + + while(1) { + gyro.read(&gx,&gy,&gz); + x = (int)gx*1000; + pc.printf("%d",x); + + wait(0.01); + + + } + +} \ No newline at end of file