Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:5ac6fdeb615e
- Child:
- 2:fc47fabf9268
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue May 24 08:28:46 2016 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+#include "MPU6050.h"
+
+DigitalOut myled(LED1);
+MPU6050 mpu(PB_9,PB_8);
+
+int main() {
+ while(1){
+ int gyro[3];
+ mpu.readGyroData(gyro); //gyro[3]に代入
+ printf("x:%d y:%d z:%d\r\n",gyro[0],gyro[1],gyro[2]);
+ wait(0.1);
+ }
+
+ /* おまけ 加速度
+ while(1){
+ int accel[3];
+ mpu.readAccelData(acc);
+ printf("x:%d y:%d z:%d\r\n",accel[0],accel[1],accel[2]);
+ }
+ */
+
+}