Wallbot_CaaS

Dependencies:   MPU6050 mbed PID

Fork of BLE_MPU6050_test6_challenge_sb by Junichi Katsu

Revision:
20:b0e1fa37856d
Parent:
19:5f1e153ef63e
Child:
21:14cf80622dd5
--- a/main.cpp	Thu May 24 04:20:45 2018 +0000
+++ b/main.cpp	Fri May 25 04:52:06 2018 +0000
@@ -7,7 +7,7 @@
 //#include "Adafruit_GFX.h"
 //#include "pictLIB.h"
 
-#define DEBUG
+//#define DEBUG
 
 Serial pc(USBTX, USBRX);
 BLEDevice  ble;
@@ -80,7 +80,7 @@
 	float left_cmd = 0;
     memcpy( &right_cmd, params->data , sizeof(right_cmd));
     memcpy( &left_cmd, params->data + sizeof(right_cmd), sizeof(left_cmd));
-	wb.SetRPM(right_cmd,left_cmd);
+	wb.SetRPM(left_cmd,right_cmd);
 #ifdef DEBUG
     //割り込みハンドラの中でシリアル通信しないこと。
     //printf("SetRPM:%f,%f",left_cmd,right_cmd)
@@ -151,13 +151,15 @@
 	//pc.printf("auto calibrate start\n\r");
 
 	//適当キャリブレーション
+	/*
 	for(int i = 0 ; i < 4 ; i++)
 	{
 		wb._calibratedMinimum[i] = 300;
 		wb._calibratedMaximum[i] = 900;
 	}
-	
-    //wb.auto_calibrate(); //自動キャリブレーション
+	*/
+    
+    wb.auto_calibrate(); //自動キャリブレーション
 #ifdef DEBUG
     for(int i = 0 ; i < 4 ; i++)
 	{