RCBControllerでモータを制御します。うおーるぼっとも動かせました。

Dependencies:   BLE_API TB6612FNG2 mbed nRF51822

Fork of BLE_RCBController2 by Junichi Katsu

うまく接続できない時は、iPhone/iPadのBluetoothをOFF->ONしてキャッシュをクリアしてみてください。

ライブラリ類をUpdateするとコンパイル出来なくなります。インポートした物をそのまま使って下さい。

RCBControllerでうおーるぼっとを操縦する例 /media/uploads/robo8080/img_1671.jpg

Components / Wallbot
This robot has switch, line sensors and motors. It controls by mbed.

RCBControllerでの操縦は次の4種類あります。 それぞれうおーるぼっとの動きが異なりますので試してみてください。

  • 左十字ボタン
  • 左のみアナログ
  • 右のみアナログ
  • 両方アナログ

うおーるぼっと(LPC1768のソケット)とHRM1017の接続はこれです。

LPC1768 ー HRM1017

p11 ーーー P0_0

p12 ーーー P0_1

p13 ーーー P0_28

p14 ーーー P0_29

p21 ーーー P0_30

p22 ーーー P0_25

GND ーーー GND

/media/uploads/robo8080/img_1711.jpg

/media/uploads/robo8080/img_1703.jpg

HRM1017の電源はうおーるぼっとのUSBコネクタからとります。 /media/uploads/robo8080/img_1674.jpg

Revision:
5:1c04bd9f8457
Parent:
4:ebda47d22091
--- a/HRM1017/btle/btle_gap.cpp	Wed Aug 20 13:41:01 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/* mbed Microcontroller Library
- * Copyright (c) 2006-2013 ARM Limited
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include "common/common.h"
-
-#include "app_timer.h"
-#include "ble_gap.h"
-#include "ble_conn_params.h"
-
-static inline uint32_t msec_to_1_25msec(uint32_t interval_ms) ATTR_ALWAYS_INLINE ATTR_CONST;
-static void   error_callback(uint32_t nrf_error);
-
-/**************************************************************************/
-/*!
-    @brief      Initialise GAP in the underlying SoftDevice
-
-    @returns
-*/
-/**************************************************************************/
-error_t btle_gap_init(void)
-{
-    ble_gap_conn_params_t gap_conn_params = {0};
-
-    gap_conn_params.min_conn_interval = msec_to_1_25msec(CFG_GAP_CONNECTION_MIN_INTERVAL_MS);  // in 1.25ms units
-    gap_conn_params.max_conn_interval = msec_to_1_25msec(CFG_GAP_CONNECTION_MAX_INTERVAL_MS);  // in 1.25ms unit
-    gap_conn_params.slave_latency     = CFG_GAP_CONNECTION_SLAVE_LATENCY;
-    gap_conn_params.conn_sup_timeout  = CFG_GAP_CONNECTION_SUPERVISION_TIMEOUT_MS / 10; // in 10ms unit
-
-    ble_gap_conn_sec_mode_t sec_mode;
-    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode); // no security is needed
-
-    ASSERT_STATUS( sd_ble_gap_device_name_set(&sec_mode, (const uint8_t *) CFG_GAP_LOCAL_NAME, strlen(CFG_GAP_LOCAL_NAME)));
-    ASSERT_STATUS( sd_ble_gap_appearance_set(CFG_GAP_APPEARANCE));
-    ASSERT_STATUS( sd_ble_gap_ppcp_set(&gap_conn_params));
-    ASSERT_STATUS( sd_ble_gap_tx_power_set(CFG_BLE_TX_POWER_LEVEL));
-
-    /* Connection Parameters */
-    enum {
-        FIRST_UPDATE_DELAY = APP_TIMER_TICKS(5000, CFG_TIMER_PRESCALER),
-        NEXT_UPDATE_DELAY  = APP_TIMER_TICKS(5000, CFG_TIMER_PRESCALER),
-        MAX_UPDATE_COUNT   = 3
-    };
-
-    ble_conn_params_init_t cp_init = {0};
-
-    cp_init.p_conn_params                  = NULL;
-    cp_init.first_conn_params_update_delay = FIRST_UPDATE_DELAY;
-    cp_init.next_conn_params_update_delay  = NEXT_UPDATE_DELAY;
-    cp_init.max_conn_params_update_count   = MAX_UPDATE_COUNT;
-    cp_init.start_on_notify_cccd_handle    = BLE_GATT_HANDLE_INVALID;
-    cp_init.disconnect_on_fail             = true;
-    cp_init.evt_handler                    = NULL;
-    cp_init.error_handler                  = error_callback;
-
-    ASSERT_STATUS ( ble_conn_params_init(&cp_init));
-
-    return ERROR_NONE;
-}
-
-/**************************************************************************/
-/*!
-    @brief      Converts msecs to an integer representing 1.25ms units
-
-    @param[in]  ms
-                The number of milliseconds to conver to 1.25ms units
-
-    @returns    The number of 1.25ms units in the supplied number of ms
-*/
-/**************************************************************************/
-static inline uint32_t msec_to_1_25msec(uint32_t interval_ms)
-{
-    return (interval_ms * 4) / 5;
-}
-
-static void error_callback(uint32_t nrf_error)
-{
-    ASSERT_STATUS_RET_VOID( nrf_error );
-}