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.
Fork of Encoder by
Diff: Locate.h
- Revision:
- 9:b00a8fba58c6
- Parent:
- 8:a5093de00347
diff -r a5093de00347 -r b00a8fba58c6 Locate.h
--- a/Locate.h	Thu Aug 11 06:21:51 2016 +0000
+++ b/Locate.h	Thu Aug 11 06:41:07 2016 +0000
@@ -26,7 +26,7 @@
     char dl, dr;    //エンコーダの初期ズレ
 
 public:
-    float rad;      //機体角度、x軸正の向きを0とする
+    float theta;      //機体角度、x軸正の向きを0とする
     float x, y;     //xy方向に進んだ距離(m換算なし)
     short v;        //ステップ速度
 
@@ -36,8 +36,9 @@
     
     void  update (int r, int l);    //位置情報を更新する
     
-    short getX();                   //x, yをmm換算して整数値として返す
-    short getY();
+    int   getX();                   //x, yをmm換算して整数値として返す
+    int   getY();
+    float getTheta();
 };
 
 
@@ -66,7 +67,7 @@
         {
             if(machine.getX() > 1000)
                 *********
-            if(machine.rad > 2)
+            if(machine.theta > 2)
                 **********
             **************
         }
    