テステス

Dependents:   robocon2017mbed_contoroler_L2

Fork of MyLib by Kiko Ishimoto

Files at this revision

API Documentation at this revision

Comitter:
kikoaac
Date:
Fri Oct 27 07:26:51 2017 +0000
Parent:
13:26bd1b20e5c9
Commit message:
offset;

Changed in this revision

Nunchuck/Nunchuck.cpp Show annotated file Show diff for this revision Revisions of this file
Nunchuck/Nunchuck.h Show annotated file Show diff for this revision Revisions of this file
--- a/Nunchuck/Nunchuck.cpp	Wed Oct 25 10:57:55 2017 +0000
+++ b/Nunchuck/Nunchuck.cpp	Fri Oct 27 07:26:51 2017 +0000
@@ -9,7 +9,7 @@
     timer.start();
     init();
     wait(0.2);
-    offset_();
+    //offset_();
 }
 
 bool Nunchuck::init()
--- a/Nunchuck/Nunchuck.h	Wed Oct 25 10:57:55 2017 +0000
+++ b/Nunchuck/Nunchuck.h	Fri Oct 27 07:26:51 2017 +0000
@@ -30,11 +30,16 @@
         void offset_(){
             offsetX = 0;
             offsetY = 0;
+            
+            for(int i = 0 ; i< 15;i++){
+                getdata();
+                wait(0.01);
+            }
             offset = false;
             wait(0.2);
             //for(int i = 0;i<20;i++){
-                offsetX = 0;//(char)analogx();
-                offsetY = 7;//(char)analogy();
+                offsetX = (char)analogx();
+                offsetY = (char)analogy();
                 //2ごうき
                 //x:252
                 //y:9