yusei sugimoeo / Mbed OS controllerForMbed_test_Re

Files at this revision

API Documentation at this revision

Comitter:
yuseis
Date:
Sat Sep 17 07:55:41 2022 +0000
Parent:
3:59ace4ccc91d
Commit message:
Re

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Sep 12 08:55:17 2022 +0000
+++ b/main.cpp	Sat Sep 17 07:55:41 2022 +0000
@@ -5,10 +5,11 @@
 #define INT_TIME 0.001
 #define INT_TIME_MS INT_TIME*1000
 
-PwmOut lfP(p21);//左前 出力
-PwmOut rfP(p22);//右前 出力
-PwmOut lbP(p23);//左後 出力
-PwmOut rbP(p24);//右後 出力
+
+RawSerial sabertooth1(p21,NC,115200);//左前 出力
+RawSerial sabertooth1(p23,NC,115200);//左後 出力
+RawSerial sabertooth2(p24,NC,115200);//右後 出力
+RawSerial sabertooth2(p22,NC,115200);//右前 出力
 DigitalOut air(p25);//エアシリンダーのつもり
 
 Serial pc(USBTX, USBRX,115200);
@@ -86,10 +87,10 @@
                 LB=joyLx+joyLy-joyRy-128;
                 RB=-joyLx+joyLy-joyRy+128;
                 
-                lfP.write(LF);
-                rfP.write(RF);
-                lbP.write(LB);
-                rbP.write(RB);
+                sabertooth1.printf("M1:%d\r\n",LF);
+                sabertooth1.printf("M2:%d\r\n",LB);
+                sabertooth2.printf("M1:%d\r\n",RB);
+                sabertooth2.printf("M2:%d\r\n",RF);
                 
                 pc.printf("%lf\t", LF);
                 pc.printf("%lf\t", RF);