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

Dependencies:   BLE_API_Native_IRC TB6612FNG2 mbed

Fork of BLE_RCBController by Junichi Katsu

  • 古いBLEライブラリを使っているのでプラットフォームは”Nordic nRF51822”を選択してください。
  • ライブラリ類はUpdateしないでください。コンパイルエラーになります。

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

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

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

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

Committer:
jksoft
Date:
Thu Jul 10 14:21:52 2014 +0000
Revision:
0:8c643bfe55b7
Child:
1:4f33a5a25063
??

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:8c643bfe55b7 1 /* mbed Microcontroller Library
jksoft 0:8c643bfe55b7 2 * Copyright (c) 2006-2013 ARM Limited
jksoft 0:8c643bfe55b7 3 *
jksoft 0:8c643bfe55b7 4 * Licensed under the Apache License, Version 2.0 (the "License");
jksoft 0:8c643bfe55b7 5 * you may not use this file except in compliance with the License.
jksoft 0:8c643bfe55b7 6 * You may obtain a copy of the License at
jksoft 0:8c643bfe55b7 7 *
jksoft 0:8c643bfe55b7 8 * http://www.apache.org/licenses/LICENSE-2.0
jksoft 0:8c643bfe55b7 9 *
jksoft 0:8c643bfe55b7 10 * Unless required by applicable law or agreed to in writing, software
jksoft 0:8c643bfe55b7 11 * distributed under the License is distributed on an "AS IS" BASIS,
jksoft 0:8c643bfe55b7 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
jksoft 0:8c643bfe55b7 13 * See the License for the specific language governing permissions and
jksoft 0:8c643bfe55b7 14 * limitations under the License.
jksoft 0:8c643bfe55b7 15 */
jksoft 0:8c643bfe55b7 16
jksoft 0:8c643bfe55b7 17 #ifndef _PROJECTCONFIG_H_
jksoft 0:8c643bfe55b7 18 #define _PROJECTCONFIG_H_
jksoft 0:8c643bfe55b7 19
jksoft 0:8c643bfe55b7 20 /*=========================================================================
jksoft 0:8c643bfe55b7 21 MCU & BOARD SELCTION
jksoft 0:8c643bfe55b7 22
jksoft 0:8c643bfe55b7 23 CFG_BOARD is one of the value defined in board.h
jksoft 0:8c643bfe55b7 24 -----------------------------------------------------------------------*/
jksoft 0:8c643bfe55b7 25 #define CFG_BOARD BOARD_PCA10001
jksoft 0:8c643bfe55b7 26 #define CFG_MCU_STRING "nRF51822"
jksoft 0:8c643bfe55b7 27 /*=========================================================================*/
jksoft 0:8c643bfe55b7 28
jksoft 0:8c643bfe55b7 29
jksoft 0:8c643bfe55b7 30 /*=========================================================================
jksoft 0:8c643bfe55b7 31 CODE BASE VERSION SETTINGS
jksoft 0:8c643bfe55b7 32
jksoft 0:8c643bfe55b7 33 Please do not modify this version number. To set a version number
jksoft 0:8c643bfe55b7 34 for your project or firmware, change the values in your 'boards/'
jksoft 0:8c643bfe55b7 35 config file.
jksoft 0:8c643bfe55b7 36 -----------------------------------------------------------------------*/
jksoft 0:8c643bfe55b7 37 #define CFG_CODEBASE_VERSION_MAJOR 0
jksoft 0:8c643bfe55b7 38 #define CFG_CODEBASE_VERSION_MINOR 1
jksoft 0:8c643bfe55b7 39 #define CFG_CODEBASE_VERSION_REVISION 0
jksoft 0:8c643bfe55b7 40 /*=========================================================================*/
jksoft 0:8c643bfe55b7 41
jksoft 0:8c643bfe55b7 42
jksoft 0:8c643bfe55b7 43 /*=========================================================================
jksoft 0:8c643bfe55b7 44 FIRMWARE VERSION SETTINGS
jksoft 0:8c643bfe55b7 45 -----------------------------------------------------------------------*/
jksoft 0:8c643bfe55b7 46 #define CFG_FIRMWARE_VERSION_MAJOR 0
jksoft 0:8c643bfe55b7 47 #define CFG_FIRMWARE_VERSION_MINOR 0
jksoft 0:8c643bfe55b7 48 #define CFG_FIRMWARE_VERSION_REVISION 0
jksoft 0:8c643bfe55b7 49 /*=========================================================================*/
jksoft 0:8c643bfe55b7 50
jksoft 0:8c643bfe55b7 51
jksoft 0:8c643bfe55b7 52 /*=========================================================================
jksoft 0:8c643bfe55b7 53 DEBUG LEVEL
jksoft 0:8c643bfe55b7 54 -----------------------------------------------------------------------
jksoft 0:8c643bfe55b7 55
jksoft 0:8c643bfe55b7 56 CFG_DEBUG Level 3: Full debug output, any failed assert
jksoft 0:8c643bfe55b7 57 will produce a breakpoint for the
jksoft 0:8c643bfe55b7 58 debugger
jksoft 0:8c643bfe55b7 59 Level 2: ATTR_ALWAYS_INLINE is null, ASSERT
jksoft 0:8c643bfe55b7 60 has text
jksoft 0:8c643bfe55b7 61 Level 1: ATTR_ALWAYS_INLINE is an attribute,
jksoft 0:8c643bfe55b7 62 ASSERT has no text
jksoft 0:8c643bfe55b7 63 Level 0: No debug information generated
jksoft 0:8c643bfe55b7 64
jksoft 0:8c643bfe55b7 65 -----------------------------------------------------------------------*/
jksoft 0:8c643bfe55b7 66 #define CFG_DEBUG (2)
jksoft 0:8c643bfe55b7 67
jksoft 0:8c643bfe55b7 68 #if (CFG_DEBUG > 3) || (CFG_DEBUG < 0)
jksoft 0:8c643bfe55b7 69 #error "CFG_DEBUG must be a value between 0 (no debug) and 3"
jksoft 0:8c643bfe55b7 70 #endif
jksoft 0:8c643bfe55b7 71 /*=========================================================================*/
jksoft 0:8c643bfe55b7 72
jksoft 0:8c643bfe55b7 73
jksoft 0:8c643bfe55b7 74 /*=========================================================================
jksoft 0:8c643bfe55b7 75 GENERAL NRF51 PERIPHERAL SETTINGS
jksoft 0:8c643bfe55b7 76 -----------------------------------------------------------------------
jksoft 0:8c643bfe55b7 77
jksoft 0:8c643bfe55b7 78 CFG_SCHEDULER_ENABLE Set this to 'true' or 'false' depending on
jksoft 0:8c643bfe55b7 79 if you use the event scheduler or not
jksoft 0:8c643bfe55b7 80
jksoft 0:8c643bfe55b7 81 -----------------------------------------------------------------------*/
jksoft 0:8c643bfe55b7 82 #define CFG_SCHEDULER_ENABLE false
jksoft 0:8c643bfe55b7 83
jksoft 0:8c643bfe55b7 84 /*------------------------------- GPIOTE ------------------------------*/
jksoft 0:8c643bfe55b7 85 #define CFG_GPIOTE_MAX_USERS 1 /**< Maximum number of users of the GPIOTE handler. */
jksoft 0:8c643bfe55b7 86
jksoft 0:8c643bfe55b7 87 /*-------------------------------- TIMER ------------------------------*/
jksoft 0:8c643bfe55b7 88 #define CFG_TIMER_PRESCALER 0 /**< Value of the RTC1 PRESCALER register. freq = (32768/(PRESCALER+1)) */
jksoft 0:8c643bfe55b7 89 #define CFG_TIMER_MAX_INSTANCE 8 /**< Maximum number of simultaneously created timers. */
jksoft 0:8c643bfe55b7 90 #define CFG_TIMER_OPERATION_QUEUE_SIZE 5 /**< Size of timer operation queues. */
jksoft 0:8c643bfe55b7 91 /*=========================================================================*/
jksoft 0:8c643bfe55b7 92
jksoft 0:8c643bfe55b7 93
jksoft 0:8c643bfe55b7 94 /*=========================================================================
jksoft 0:8c643bfe55b7 95 BTLE SETTINGS
jksoft 0:8c643bfe55b7 96 -----------------------------------------------------------------------*/
jksoft 0:8c643bfe55b7 97
jksoft 0:8c643bfe55b7 98 #define CFG_BLE_TX_POWER_LEVEL 4 /**< in dBm (Valid values are -40, -20, -16, -12, -8, -4, 0, 4) */
jksoft 0:8c643bfe55b7 99
jksoft 0:8c643bfe55b7 100 /*---------------------------- BOND MANAGER ---------------------------*/
jksoft 0:8c643bfe55b7 101 #define CFG_BLE_BOND_FLASH_PAGE_BOND (BLE_FLASH_PAGE_END-1) /**< Flash page used for bond manager bonding information.*/
jksoft 0:8c643bfe55b7 102 #define CFG_BLE_BOND_FLASH_PAGE_SYS_ATTR (BLE_FLASH_PAGE_END-3) /**< Flash page used for bond manager system attribute information. TODO check if we can use BLE_FLASH_PAGE_END-2*/
jksoft 0:8c643bfe55b7 103 #define CFG_BLE_BOND_DELETE_BUTTON_NUM 0 /**< Button to press to delete bond details during init */
jksoft 0:8c643bfe55b7 104
jksoft 0:8c643bfe55b7 105 /*------------------------------ SECURITY -----------------------------*/
jksoft 0:8c643bfe55b7 106 #define CFG_BLE_SEC_PARAM_MITM 0 /**< Man In The Middle protection not required. */
jksoft 0:8c643bfe55b7 107 #define CFG_BLE_SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /**< No I/O capabilities. */
jksoft 0:8c643bfe55b7 108 #define CFG_BLE_SEC_PARAM_OOB 0 /**< Out Of Band data not available. */
jksoft 0:8c643bfe55b7 109 #define CFG_BLE_SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */
jksoft 0:8c643bfe55b7 110 #define CFG_BLE_SEC_PARAM_MAX_KEY_SIZE 16
jksoft 0:8c643bfe55b7 111
jksoft 0:8c643bfe55b7 112 /*--------------------------------- GAP -------------------------------*/
jksoft 0:8c643bfe55b7 113 #define CFG_GAP_APPEARANCE BLE_APPEARANCE_GENERIC_TAG
jksoft 0:8c643bfe55b7 114 #define CFG_GAP_LOCAL_NAME "mbed HRM1017"
jksoft 0:8c643bfe55b7 115
jksoft 0:8c643bfe55b7 116 #define CFG_GAP_CONNECTION_MIN_INTERVAL_MS 50/*500*/ /**< Minimum acceptable connection interval */
jksoft 0:8c643bfe55b7 117 #define CFG_GAP_CONNECTION_MAX_INTERVAL_MS 100/*1000*/ /**< Maximum acceptable connection interval */
jksoft 0:8c643bfe55b7 118 #define CFG_GAP_CONNECTION_SUPERVISION_TIMEOUT_MS 4000 /**< Connection supervisory timeout */
jksoft 0:8c643bfe55b7 119 #define CFG_GAP_CONNECTION_SLAVE_LATENCY 0 /**< Slave Latency in number of connection events. */
jksoft 0:8c643bfe55b7 120
jksoft 0:8c643bfe55b7 121 #define CFG_GAP_ADV_INTERVAL_MS 25 /**< The advertising interval in miliseconds, should be multiply of 0.625 */
jksoft 0:8c643bfe55b7 122 #define CFG_GAP_ADV_TIMEOUT_S 180 /**< The advertising timeout in units of seconds. */
jksoft 0:8c643bfe55b7 123 /*=========================================================================*/
jksoft 0:8c643bfe55b7 124
jksoft 0:8c643bfe55b7 125
jksoft 0:8c643bfe55b7 126 /*=========================================================================
jksoft 0:8c643bfe55b7 127 VALIDATION
jksoft 0:8c643bfe55b7 128 -----------------------------------------------------------------------*/
jksoft 0:8c643bfe55b7 129 #if CFG_BLE_TX_POWER_LEVEL != -40 && CFG_BLE_TX_POWER_LEVEL != -20 && CFG_BLE_TX_POWER_LEVEL != -16 && CFG_BLE_TX_POWER_LEVEL != -12 && CFG_BLE_TX_POWER_LEVEL != -8 && CFG_BLE_TX_POWER_LEVEL != -4 && CFG_BLE_TX_POWER_LEVEL != 0 && CFG_BLE_TX_POWER_LEVEL != 4
jksoft 0:8c643bfe55b7 130 #error "CFG_BLE_TX_POWER_LEVEL must be -40, -20, -16, -12, -8, -4, 0 or 4"
jksoft 0:8c643bfe55b7 131 #endif
jksoft 0:8c643bfe55b7 132 /*=========================================================================*/
jksoft 0:8c643bfe55b7 133
jksoft 0:8c643bfe55b7 134 #endif /* _PROJECTCONFIG_H_ */