RT-AICHIP-sample
mode_BluetoothSetting.c
[詳解]
1 /* ------------------------------------------------------------ *
2 File mode_BluetoothSetting.c
3 
4 Bluetoothモジュールのボーレート等を設定する.
5 
6  //設定項目//
7  Bluetoothデバイス名:RT-AICHIP
8  ボーレート:115200bps
9  動作モード:スレーブモード
10  設定変更後リブートコマンドを送る.
11 操作:
12  右SW: モータのdutyを変更
13  左SW: 長押しでモード選択へ繊維
14 
15 * ------------------------------------------------------------ */
16 #include "mode_Debug.h"
17 #include "type.h"
18 #include "AICHIPFunction.h"
19 #include "UserInterface.h"
20 #include "SystemTickTimer.h"
21 #include "debug.h"
22 
23 
25 {
26  turnGreenLED(1);
27  myPrintfUART("############ Bluetooth setting mode ################\n");
28  wait1msec(300);
29  myPrintfUART("$$$"); //コマンドモードに入る
30  wait1msec(2000);
31  myPrintfUART("SM,0\r"); //動作モードをスレーブモードに変更
32  wait1msec(2000);
33  myPrintfUART("SU,115K\r");//ボーレートを115200bpsに変更
34  wait1msec(2000);
35  myPrintfUART("SN,RT-AICHIP\r");//デバイス名の変更
36  wait1msec(2000);
37  myPrintfUART("R,1\r"); //リブート
38  wait1msec(2000);
39 
40  while(1)
41  {
42  wait1msec(100);
43  //モード選択へ遷移
44  if( getLeftSWcount() > 1000)
45  {
46  setDutyMotor(0.0);
47  turnGreenLED(0);
48  myPrintfUART("\t return mode select \n");
49  break;
50  }
51  }
52 }
53 
54 /******************************************************************************
55 ** End Of File
56 ******************************************************************************/
int myPrintfUART(const char *fmt,...)
Definition: debug.c:42
void setDutyMotor(float pwm_duty)
void mode_BluetoothSetting(void)
uint16_t getLeftSWcount(void)
Definition: UserInterface.c:98
void wait1msec(uint32_t wait_count)
void turnGreenLED(uint8_t state)