鈴木は下ネタ大好き

Dependencies:   MPU6050 SDFileSystem mbed

佐藤健士郎は変態

Files at this revision

API Documentation at this revision

Comitter:
yoritomo
Date:
Fri Jun 08 17:13:20 2018 +0000
Child:
1:7b6bdf5fd700
Commit message:
?????????;

Changed in this revision

MPU6050.lib Show annotated file Show diff for this revision Revisions of this file
SDFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MPU6050.lib	Fri Jun 08 17:13:20 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/garfieldsg/code/MPU6050/#662207e34fba
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Fri Jun 08 17:13:20 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/SDFileSystem/#519e9c096fcf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jun 08 17:13:20 2018 +0000
@@ -0,0 +1,56 @@
+#include "mbed.h"
+#include "SDFileSystem.h"
+#include "MPU6050.h"
+ 
+SDFileSystem sd(dp2, dp1, dp6, dp4,"sd"); 
+
+DigitalOut myled(LED1);
+Serial pc(USBTX,USBRX);
+MPU6050 mpu;
+Timer t;
+
+int16_t ax, ay, az;
+int16_t gx, gy, gz;
+
+char c;
+
+int main() {
+    
+    
+    pc.printf("MPU6050 test\n\n");
+    pc.printf("MPU6050 initialize \n");
+
+    mpu.initialize();
+    pc.printf("MPU6050 testConnection \n");
+
+    bool mpu6050TestResult = mpu.testConnection();
+    if(mpu6050TestResult) {
+        pc.printf("MPU6050 test passed \n");
+    } else {
+        pc.printf("MPU6050 test failed \n");
+    }
+    t.start();
+    
+    pc.printf("Hello World!\n"); 
+    mkdir("/sd/ANBU!", 0777);
+    
+    while(1){  
+        FILE *fp = fopen("/sd/ANBU!/AUO.txt", "a");
+        if(fp == NULL) {
+            error("Could not open file for write\n"); 
+            }
+
+        wait(0.1);
+        mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
+        //writing current accelerometer and gyro position 
+        pc.printf("%f, %d, %d, %d, %d,%d, %d\n\r",t.read(),ax,ay,az,gx,gy,gz);
+        fprintf(fp,"%f, %d, %d, %d, %d,%d, %d\n\r",t.read(),ax,ay,az,gx,gy,gz);       
+
+  
+    fprintf(fp,"\n\r");   
+    pc.printf("\n\r");
+    fclose(fp);
+    free(fp);
+    
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jun 08 17:13:20 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34
\ No newline at end of file