三浦 颯太 / Mbed 2 deprecated MainBoard2019_LineHub_ver2

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers setup.h Source File

setup.h

00001 #include "mbed.h"
00002 
00003 // ---------- 設定ファイル ----------//
00004 
00005 // RS485
00006 
00007 #define  BORATE  9600
00008 
00009 // PORT 
00010     //  1  ポート接続
00011     //  0  ポート未使用
00012 
00013 #define  PORT_0  1
00014 #define  PORT_1  1
00015 #define  PORT_2  1
00016 #define  PORT_3  1
00017 #define  PORT_4  1
00018 #define  PORT_5  0
00019 #define  PORT_6  0
00020 #define  PORT_7  0
00021 
00022 //********** pin define **********//
00023 #define  SELECT1_0  PB_4
00024 #define  SELECT1_1  PB_5
00025 #define  SELECT1_2  PB_3
00026 #define  SELECT1_3  PB_1
00027 #define  SELECT2_0  PF_0
00028 #define  SELECT2_1  PF_1
00029 #define  SELECT2_2  PA_8
00030 #define  SELECT2_3  PA_11
00031 #define  SELECT3_0  PA_4
00032 #define  SELECT3_1  PA_5
00033 #define  SELECT3_2  PA_7
00034 #define  SELECT3_3  PA_6
00035 #define  Z0         PA_0
00036 #define  Z1         PA_1
00037 #define  Z2         PA_3
00038 #define  SDA        PB_7
00039 #define  SCL        PB_6
00040 #define  UART_SE    PA_2
00041 #define  UARTTX     PA_9
00042 #define  UARTRX     PA_10
00043 //********** pin define **********//
00044 
00045 #define PORT_NUM 8
00046 #define SENSOR_NUM 6
00047 
00048 const int sensor_number[PORT_NUM][SENSOR_NUM] = {{ 0, 1, 2, 3, 4, 5},
00049                                                  {12,13,14,15, 7, 6},
00050                                                  {22,23, 8, 9,10,11},
00051                                                  {16,17,18,19,20,21},
00052                                                  {27,26,25,24,40,41},
00053                                                  {28,29,30,31,38,39},
00054                                                  {32,33,34,35,36,37},
00055                                                  {42,43,44,45,36,47}};
00056                                                  
00057 const int sensor_weight[SENSOR_NUM] = { 2, 1, 0, 0,-1,-2};
00058 
00059 const float THRESHOLD = 0.80f;  // 閾値 (しきい値)
00060 
00061 const char AC_WEIGHT = 98;  // センサー全てが白線にのっていたときの出力
00062 const char NC_WEIGHT = 99;  // 白線を感知しなかったときの出力
00063 const char NO_PORT = 97;    // ポートを使ってないときの出力
00064 
00065 
00066