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.
Dependencies: mbed move3wheel
Fork of F3RC-mbed-new4 by
Diff: User.cpp
- Revision:
- 20:18da3cef9b39
- Parent:
- 19:509531c29e65
--- a/User.cpp Thu Sep 13 13:35:29 2018 +0000
+++ b/User.cpp Fri Sep 14 07:04:12 2018 +0000
@@ -22,6 +22,7 @@
double receive_data/*,true_data*/;
double now_angle,target_angle,out;
int count=0;
+int temp1, temp2;
PwmOut motor0CW(p21); //0番motor 外から見て時計回り
PwmOut motor0CCW(p22); //0番motor 反時計回り
@@ -78,6 +79,16 @@
//ボタンの処理
ButtonState = ((ps3report*)(data + 1))->ButtonState;
}
+
+///////////////////////////RスティックとLスティックの値を入れかえる///////////////////
+
+ temp1 = LSX;
+ LSX = RSX;
+ RSX = temp1;
+
+ temp2 = LSY;
+ LSY = LSY;
+ RSY = temp2;
///////////////////////////ここからmotorのプログラム///////////////////////////////
@@ -327,7 +338,7 @@
wait(0.1);
if((ButtonState >> BUTTONTRIANGEL)&1 == 1) {
data1=1;
-
+ printf("5");
}
}
@@ -336,6 +347,7 @@
wait(0.1);
if((ButtonState >> BUTTONCIRCLE)&1 == 1) {
data1=2;
+ printf("2");
}
}
@@ -344,6 +356,7 @@
wait(0.1);
if((ButtonState >> BUTTONCROSS)&1 == 1) {
data1=3;
+ printf("3");
}
}
@@ -352,6 +365,7 @@
wait(0.1);
if((ButtonState >> BUTTONSQUARE)&1 == 1) {
data1=4;
+ printf("4");
}
}
@@ -360,6 +374,8 @@
wait(0.1);
if((ButtonState >> BUTTONLEFT)&1 == 1) {
data1=5;
+ printf("5");
+
}
}
