計測輪ボード用プログラム

Dependencies:   SerialMultiByte measuring_wheel SoftPWM Eigen

Revision:
6:f4a6cc918833
Parent:
5:9332620c08c6
--- a/main.cpp	Tue Dec 18 19:00:19 2018 +0900
+++ b/main.cpp	Tue Sep 03 05:37:17 2019 +0000
@@ -1,30 +1,16 @@
 #include "mbed.h"
 #include "measuring_wheel.h"
+#include "pin_config.h"
 
-Serial pc(USBTX, USBRX, 115200);
-MeasuringWheel measuring(PA_9, PA_8, PA_0, PA_1, PB_7, PB_6);
-// MeasuringWheel measuring(PB_6,PB_7,PA_8,PA_9,PA_6,PA_7);
+Serial pc(USBTX,USBRX, 115200);
+//3,1,5
+MeasuringWheel measuring(PA_1,PA_0, PA_8, PA_9, PB_6,PB_7);
+//1,3,4
+//MeasuringWheel measuring(PB_6, PB_7, PA_8, PA_9, PC_6, PC_7);
+//MeasuringWheel measuring(encoder1_a, encoder1_b, encoder2_a, encoder2_b, encoder3_a, encoder3_b);
 
 int main() {
-  measuring.wheelDiameter(48, 48, 48);
-  while (true) {
-    // pc.printf("%d,%d,\n",(int)measuring.getOutX(),(int)measuring.getOutY());
-    //        pc.printf("w1 = %f, w2 = %f, w3 =
-    //        %f\r\n",measuring.getWheel1(),measuring.getWheel2(),measuring.getWheel3());
-    // pc.printf("yaw = %f\r\n",measuring.getjyroAngle());
-    /// Thread::wait(100);
-    // measuring.debugLed[1]->write(!measuring.debugLed[1]->read());
-    if (abs((int)measuring.getjyroAngle()) % 6 > 3) {
-      measuring.debugLed[1]->write(true);
-    } else {
-      measuring.debugLed[1]->write(false);
+    while (true) {
+        pc.printf("x = %f,  y = %f, theta = %f\r\n", measuring.getOutX(), measuring.getOutY(), measuring.getjyroAngle());
     }
-    if (abs((int)measuring.getOutX()) % 6 > 3) {
-      measuring.debugLed[2]->write(true);
-    } else {
-      measuring.debugLed[2]->write(false);
-    }
-    // kwait(fabs(measuring.getjyroAngle()) / 1.0);
-    wait(0.1);
-  }
 }