a

Dependencies:   mbed

Revision:
12:7e33e400a48d
Parent:
11:c1a22e2e3534
Child:
13:48c4a4c95e77
--- a/main.h	Wed Sep 04 05:31:40 2019 +0000
+++ b/main.h	Sun Sep 08 09:57:22 2019 +0000
@@ -36,26 +36,24 @@
 //#define PALETTE(color)\
 //for(int s=0; s<3; s++) LED[s]=color&1<<s
 #define PALETTE(color)\
-for(int s=0; s<2; s++)\
+for(int s=0; s<3; s++)\
 i2c.Out_Set(Out_Data, s+6, color&1<<s);\
-i2c.Out(Out_Data,8)
 
 /* 型定義 --------------------------------------------------------------------*/
-typedef enum
-{
-  test_motor,
-  test_motor2,
-  test_motor3,
-  test_motor4,
-  test_motor5,
-  test_motor6,
-  test_motor7,
-  test_motor8,
-  Motor_MAX
+typedef enum {
+    test_motor,
+    test_motor2,
+    test_motor3,
+    test_motor4,
+    test_motor5,
+    test_motor6,
+    test_motor7,
+    test_motor8,
+    Motor_MAX
 } _Motor_;
 
 
-typedef enum{
+typedef enum {
     limit,
     limit1,
     limit2,
@@ -65,29 +63,25 @@
     limit6,
     limit7,
     IN_MAX
-}_limit_;
-typedef enum{
+} _limit_;
+typedef enum {
     out1,
     out2,
     out3,
     out4,
     ExTowel,
     OUT_MAX
-}_OUT_;
+} _OUT_;
 
 typedef enum {
     BLACK,
-//    GREEN,
+    BLUE,
     RED,
-//    YELLOW,
-    BLUE,
-//    CYAN,
     MAGENTA,
-//    WHITE,
-
-
-
-
+    GREEN,
+    CYAN,
+    YELLOW,
+    WHITE,
 
     COLOR_MAX
 
@@ -121,33 +115,37 @@
     {0,3,0},        // タオル展開
     {1,0,0},        // タオルの中央
     {1,1,0},        // 全体
-    {1,2,0},        // 赤
-    {1,3,0},        // 青
+    {41,0,0},        // g
+    {41,1,0},        // r
+    {41,2,0},        // b;
 };
-/* 変数宣言 ------------------------------------------------------------------*/
+    /* 変数宣言 ------------------------------------------------------------------*/
 
-/* 関数宣言 ------------------------------------------------------------------*/
+    /* 関数宣言 ------------------------------------------------------------------*/
 //メカナム基本動作
-void mecanum_Move(int lx, int ly, int rx);
+    void mecanum_Move(int lx, int ly, int rx);
 
 //角度補正
 //n_angle: 現在の角度
 //t_angle: 目標の角度
-void AngleCorrection(double n_angle, double t_angle);
+    void AngleCorrection(double n_angle, double t_angle);
 
-/*クラス宣言-------------------------------------------------------------------*/
-Y_I2C i2c(PB_9, PB_8);           // I2C
-SBDBT sbdbt(PA_0, PA_1, 9600);   // SDBDT
-BNO055 bno(PC_9, PA_8);
-DigitalOut LED[]= {PA_10,PB_4,PB_5};
-Serial pc(USBTX, USBRX, 115200);
+    /*クラス宣言-------------------------------------------------------------------*/
+    Y_I2C i2c(PB_9, PB_8);           // I2C
+    SBDBT sbdbt(PA_0, PA_1, 9600);   // SDBDT
+    BNO055 bno(PC_9, PA_8);
+    DigitalOut LED[]= {PA_10,PB_4,PB_5};
+    Serial pc(USBTX, USBRX, 115200);
 
 //半自動の時に使う
-Timer tim;
+    Timer tim;
 
 //角度補正の時に使う
-Timer drift_tim;
+    Timer drift_tim;
+
+//上下移動の保持に使う
+    Timer keep_tim[2];
 
 #endif /* _MAIN_H_ */
 
-/******************************** END OF FILE *********************************/
+    /******************************** END OF FILE *********************************/