RCBControllerでモータを制御します。うおーるぼっとも動かせました。
Dependencies: BLE_API_Native_IRC TB6612FNG2 mbed
Fork of BLE_RCBController by
- 古いBLEライブラリを使っているのでプラットフォームは”Nordic nRF51822”を選択してください。
- ライブラリ類はUpdateしないでください。コンパイルエラーになります。
うまく接続できない時は、iPhone/iPadのBluetoothをOFF->ONしてキャッシュをクリアしてみてください。
RCBControllerでうおーるぼっとを操縦する例
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コネクタからとります。
BLE_API_Native_IRC/hw/nRF51822n/nordic/nrf-sdk/ble/rpc/ble_rpc_defines.h@0:8c643bfe55b7, 2014-07-10 (annotated)
- Committer:
- jksoft
- Date:
- Thu Jul 10 14:21:52 2014 +0000
- Revision:
- 0:8c643bfe55b7
??
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:8c643bfe55b7 | 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. |
jksoft | 0:8c643bfe55b7 | 2 | * |
jksoft | 0:8c643bfe55b7 | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
jksoft | 0:8c643bfe55b7 | 4 | * Terms and conditions of usage are described in detail in NORDIC |
jksoft | 0:8c643bfe55b7 | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
jksoft | 0:8c643bfe55b7 | 6 | * |
jksoft | 0:8c643bfe55b7 | 7 | * Licensees are granted free, non-transferable use of the information. NO |
jksoft | 0:8c643bfe55b7 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
jksoft | 0:8c643bfe55b7 | 9 | * the file. |
jksoft | 0:8c643bfe55b7 | 10 | * |
jksoft | 0:8c643bfe55b7 | 11 | */ |
jksoft | 0:8c643bfe55b7 | 12 | |
jksoft | 0:8c643bfe55b7 | 13 | /** @file |
jksoft | 0:8c643bfe55b7 | 14 | * |
jksoft | 0:8c643bfe55b7 | 15 | * @defgroup rpc_cmd_defines Defines related to serialized BLE commands. |
jksoft | 0:8c643bfe55b7 | 16 | * @{ |
jksoft | 0:8c643bfe55b7 | 17 | * @ingroup ble_sdk_lib |
jksoft | 0:8c643bfe55b7 | 18 | * |
jksoft | 0:8c643bfe55b7 | 19 | * @brief Defines for serialized BLE commands. |
jksoft | 0:8c643bfe55b7 | 20 | * |
jksoft | 0:8c643bfe55b7 | 21 | */ |
jksoft | 0:8c643bfe55b7 | 22 | |
jksoft | 0:8c643bfe55b7 | 23 | #ifndef BLE_RPC_DEFINES_H__ |
jksoft | 0:8c643bfe55b7 | 24 | #define BLE_RPC_DEFINES_H__ |
jksoft | 0:8c643bfe55b7 | 25 | |
jksoft | 0:8c643bfe55b7 | 26 | #define RPC_CMD_OP_CODE_POS 0 /**< Position of the Op Code in the command buffer.*/ |
jksoft | 0:8c643bfe55b7 | 27 | #define RPC_CMD_DATA_POS 1 /**< Position of the data in the command buffer.*/ |
jksoft | 0:8c643bfe55b7 | 28 | |
jksoft | 0:8c643bfe55b7 | 29 | #define RPC_CMD_RESP_PKT_TYPE_POS 0 /**< Position of Packet type in the command response buffer.*/ |
jksoft | 0:8c643bfe55b7 | 30 | #define RPC_CMD_RESP_OP_CODE_POS 1 /**< Position of the Op Code in the command response buffer.*/ |
jksoft | 0:8c643bfe55b7 | 31 | #define RPC_CMD_RESP_STATUS_POS 2 /**< Position of the status field in the command response buffer.*/ |
jksoft | 0:8c643bfe55b7 | 32 | |
jksoft | 0:8c643bfe55b7 | 33 | #define RPC_BLE_FIELD_LEN 1 /**< Optional field length size in bytes. */ |
jksoft | 0:8c643bfe55b7 | 34 | #define RPC_BLE_FIELD_PRESENT 0x01 /**< Value to indicate that an optional field is encoded in the serialized packet, e.g. white list. */ |
jksoft | 0:8c643bfe55b7 | 35 | #define RPC_BLE_FIELD_NOT_PRESENT 0x00 /**< Value to indicate that an optional field is not encoded in the serialized packet. */ |
jksoft | 0:8c643bfe55b7 | 36 | |
jksoft | 0:8c643bfe55b7 | 37 | #define RPC_ERR_CODE_SIZE 4 /**< BLE API err_code size in bytes. */ |
jksoft | 0:8c643bfe55b7 | 38 | #define BLE_PKT_TYPE_SIZE 1 /**< Packet type (@ref ble_rpc_pkt_type_t) field size in bytes. */ |
jksoft | 0:8c643bfe55b7 | 39 | #define BLE_OP_CODE_SIZE 1 /**< Operation code field size in bytes. */ |
jksoft | 0:8c643bfe55b7 | 40 | |
jksoft | 0:8c643bfe55b7 | 41 | #define RPC_BLE_CMD_RESP_PKT_MIN_SIZE 6 /**< Minimum length of a command response. */ |
jksoft | 0:8c643bfe55b7 | 42 | #define RPC_BLE_PKT_MAX_SIZE 596 /**< Maximum size for a BLE packet on the HCI Transport layer. This value is the hci_mem_pool buffer size minus the HCI Transport size. @note This value must be aligned with TX_BUF_SIZE in hci_mem_pool_internal.h. */ |
jksoft | 0:8c643bfe55b7 | 43 | |
jksoft | 0:8c643bfe55b7 | 44 | /**@brief The types of packets. */ |
jksoft | 0:8c643bfe55b7 | 45 | typedef enum |
jksoft | 0:8c643bfe55b7 | 46 | { |
jksoft | 0:8c643bfe55b7 | 47 | BLE_RPC_PKT_CMD, /**< Command packet type. */ |
jksoft | 0:8c643bfe55b7 | 48 | BLE_RPC_PKT_RESP, /**< Command Response packet type. */ |
jksoft | 0:8c643bfe55b7 | 49 | BLE_RPC_PKT_EVT, /**< Event packet type. */ |
jksoft | 0:8c643bfe55b7 | 50 | BLE_RPC_PKT_TYPE_MAX /**< Upper bound. */ |
jksoft | 0:8c643bfe55b7 | 51 | } ble_rpc_pkt_type_t; |
jksoft | 0:8c643bfe55b7 | 52 | |
jksoft | 0:8c643bfe55b7 | 53 | #endif // BLE_RPC_DEFINES_H__ |
jksoft | 0:8c643bfe55b7 | 54 | |
jksoft | 0:8c643bfe55b7 | 55 | /** @} */ |