takuya ichise
/
TI_MPU6050_SAMPLE
This is a sample of library TI_MPU6050.
Revision 0:b122db65cd64, committed 2018-06-04
- Comitter:
- tichise
- Date:
- Mon Jun 04 22:42:56 2018 +0000
- Commit message:
- new
Changed in this revision
diff -r 000000000000 -r b122db65cd64 TI_MPU6050.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TI_MPU6050.lib Mon Jun 04 22:42:56 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/tichise/code/TI_MPU6050/#bc1e8a435c95
diff -r 000000000000 -r b122db65cd64 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jun 04 22:42:56 2018 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" +#include "TI_MPU6050.h" + +TI_MPU6050 mpu6050; + +DigitalOut led1(LED1); + +int main() { + mpu6050.setSleepEnabled(false); + + while(1) { + if (mpu6050.isHorizontal()) { + led1 = 1; + } else { + led1 = 0; + } + + int verticalAngle = mpu6050.getVerticalAngle(); + printf("verticalAngle is %d\n\r", verticalAngle); + } +}
diff -r 000000000000 -r b122db65cd64 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Jun 04 22:42:56 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/5aab5a7997ee \ No newline at end of file