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: SBDBT arrc_mbed BNO055
Revision 3:6fb5c3218608, committed 2022-01-21
- Comitter:
- guesta
- Date:
- Fri Jan 21 09:08:26 2022 +0000
- Parent:
- 2:612efbe94f42
- Child:
- 4:867c2b5cf81a
- Commit message:
- a
Changed in this revision
| library.lib | Show diff for this revision Revisions of this file |
| library/function.hpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/library.lib Fri Jan 21 08:57:07 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -https://os.mbed.com/users/guesta/code/library/#d1f0cad31502
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/library/function.hpp Fri Jan 21 09:08:26 2022 +0000
@@ -0,0 +1,47 @@
+#ifndef function_hpp
+#define function_hpp
+#include "mbed.h"
+
+//変数
+bool auto_mode = false;
+int x_component;
+int y_component;
+int l2_num;
+int r2_num;
+
+//スティックのx成分取得
+bool getLstick_x(int rx_data,int &tx_data){
+ x_component = rx_data;
+ return true;
+}
+
+//スティックのy成分取得
+bool getLstick_y(int rx_data,int &tx_data){
+ y_component = rx_data;
+ return true;
+}
+
+//L1取得
+bool getL2(int rx_data,int &tx_data){
+ l2_num = rx_data;
+ return true;
+}
+
+//R2取得
+bool getR2(int rx_data,int &tx_data){
+ r2_num = rx_data;
+ return true;
+}
+
+
+//自動、手動モード切り替え
+bool change_mode(int rx_data,int &tx_data){
+ if(rx_data == 1){
+ auto_mode =! auto_mode;
+ while(auto_mode == 0);
+ }
+ return true;
+}
+
+
+#endif
\ No newline at end of file