
LEDをON(文字列'a'を送る)OFF(文字列'b'を送る)できるMSC
Dependencies: BLE_API mbed nRF51822
Fork of nRF51822_SimpleChat by
Revision 9:c725becdd6aa, committed 2017-02-12
- Comitter:
- ke_ix1
- Date:
- Sun Feb 12 10:23:13 2017 +0000
- Parent:
- 8:0d98c9aca74c
- Commit message:
- LedLib?????MSC
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Jan 18 05:33:13 2017 +0000 +++ b/main.cpp Sun Feb 12 10:23:13 2017 +0000 @@ -31,8 +31,6 @@ #include "TxPower.h" //#include "DFUService.h" -LocalFileSystem local("local"); // マウントポイントを定義(ディレクトリパスになる) - #define BLE_UUID_TXRX_SERVICE 0x0000 /**< The UUID of the Nordic UART Service. */ #define BLE_UUID_TX_CHARACTERISTIC 0x0003 /**< The UUID of the TX Characteristic. */ @@ -43,18 +41,26 @@ #define DIGITAL_OUT_PIN P0_5 //Nano // TX POWER用 #include "ble_gap.h" -#define TX_POWER 0 +#define TX_POWER -4 //機器設定 //#define TX_ZERO //#define TX_POWER_CALI -10 //const static char DEVICE_NAME[] = "nRF51DK"; // change this -#define TX_POWER_CALI -7 -const static char DEVICE_NAME[] = "51822"; // change this +//#define TX_POWER_CALI -7 +//const static char DEVICE_NAME[] = "51822"; // change this //#define TX_POWER_CALI -15 //const static char DEVICE_NAME[] = "Nano"; // change this +//#define TX_POWER_CALI -7//-29//<-缶ケースにNano -17//<-は何もないときNano +//const static char DEVICE_NAME[] = "MN1"; // change this + +#define TX_POWER_CALI -12//-29//<-缶ケースにNano -17//<-は何もないときNano +const static char DEVICE_NAME[] = "MN10"; // change this + + + //反映してない 二箇所設定変更する場所ある //static int tx_power = TX_POWER + TX_POWER_CALI; @@ -112,8 +118,6 @@ */ //02f3f538-8d11-4802-b6fc-fb6616d4cd70 - - uint8_t txPayload[TXRX_BUF_LEN] = {0,}; uint8_t rxPayload[TXRX_BUF_LEN] = {0,}; @@ -165,6 +169,7 @@ // if(led1 == 0) { led1 = 1; ledori1 = 0; + // } else { // led1 = 0; // } @@ -188,7 +193,7 @@ //ここから------------- char bufbuf_c[20]; uint8_t bufbuf[40]; - sprintf(bufbuf_c, "%d", newTxPower + TX_POWER_CALI); + sprintf(bufbuf_c, "%d", newTxPower + TX_POWER_CALI); int a; for(a=0; bufbuf_c[a] != '\0'; a++) { bufbuf[a] = bufbuf_c[a]; @@ -221,7 +226,7 @@ //ここから------------- char bufbuf_c[20]; uint8_t bufbuf[40]; - sprintf(bufbuf_c, "%s", "Mn.Out.Led"); + sprintf(bufbuf_c, "%s", "Out.Led"); int a; for(a=0; bufbuf_c[a] != '\0'; a++) { bufbuf[a] = bufbuf_c[a]; @@ -287,20 +292,6 @@ pc.attach( uartCB , pc.RxIrq); - - FILE *fp; - FILE *fpr; - char ch[40]; - - fp = fopen("/local/out.txt", "w"); // ファイルを書き込みモードで開く - fprintf(fp, "Hello World!"); - fclose(fp); - - fpr = fopen("/local/out.txt", "r"); - fscanf(fp, "%s", ch); - pc.printf("%s\r\n",ch); - - //txPowerService = new TxPowerService(ble, -40); //txPowerService->updateTxPower(TX_POWER);