2022_Ateam_MOTORprogramをscrp_slaveでメインマイコンからコントローラー状況を読み取れるように改良。 また、モータに0以外のpwmが送られている場合に基盤付属のledが点灯するようにした。

Dependencies:   SBDBT arrc_mbed BNO055

Revision:
11:264f992664b0
Parent:
10:ad8fced7d6b6
Child:
12:894e5ac49810
--- a/library/function.hpp	Fri Mar 11 04:24:27 2022 +0000
+++ b/library/function.hpp	Tue Mar 22 00:35:37 2022 +0000
@@ -6,25 +6,42 @@
 bool auto_mode = false;
 int x_component;
 int y_component;
+int l_x_component;
+int l_y_component;
 int l2_num;
 int r2_num;
 bool up;
 bool down;
 bool l1;
+bool r1;
 bool auto_start;
+bool stop;
+bool auto_move;
+bool redZone = 0;
 
-//スティックのx成分取得
+//Rスティックのx成分取得
 bool getLstick_x(int rx_data,int &tx_data){
     x_component = rx_data;
     return true;
 }
 
-//スティックのy成分取得
+//Rスティックのy成分取得
 bool getLstick_y(int rx_data,int &tx_data){
     y_component = rx_data;
     return true;
 }
 
+//Lスティックのx成分取得
+bool getRstick_x(int rx_data,int &tx_data){
+    l_x_component = rx_data;
+    return true;
+}
+
+bool getRstick_y(int rx_data,int &tx_data){
+    l_y_component = rx_data;
+    return true;
+}
+
 //L1取得
 bool getL2(int rx_data,int &tx_data){
      l2_num = rx_data;
@@ -62,9 +79,34 @@
     return true;
 }
 
+//R1取得
+bool getR1(int rx_data,int &tx_data){
+    r1 = rx_data;
+    return true;
+}
+
 //auto_start取得
 bool getStart(int rx_data,int &tx_data){
     auto_start = rx_data;
     return true;
 }
+
+//自動移動開始読み取り
+bool getCircle(int rx_data,int &tx_data){
+    auto_move = rx_data;
+    return true;
+}
+
+//フィールド読み取り
+bool getZone(int rx_data,int &tx_data){
+    redZone = rx_data;
+    return true;
+}
+    
+//非常停止
+bool getStop(int rx_data,int &tx_data){
+    stop = rx_data;
+    return true;
+}
+
 #endif
\ No newline at end of file