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

Committer:
jksoft
Date:
Wed Aug 20 13:24:20 2014 +0000
Revision:
1:48f6e08a3ac2
2014.08.20?????BLE?????????????; ???mbed?????????????????; mbed HRM1017; Nordic nRF51822

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 1:48f6e08a3ac2 1 /* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
jksoft 1:48f6e08a3ac2 2 *
jksoft 1:48f6e08a3ac2 3 * The information contained herein is confidential property of Nordic Semiconductor. The use,
jksoft 1:48f6e08a3ac2 4 * copying, transfer or disclosure of such information is prohibited except by express written
jksoft 1:48f6e08a3ac2 5 * agreement with Nordic Semiconductor.
jksoft 1:48f6e08a3ac2 6 *
jksoft 1:48f6e08a3ac2 7 */
jksoft 1:48f6e08a3ac2 8 /**
jksoft 1:48f6e08a3ac2 9 @addtogroup BLE_GATT Generic Attribute Profile (GATT) Common
jksoft 1:48f6e08a3ac2 10 @{
jksoft 1:48f6e08a3ac2 11 @brief Common definitions and prototypes for the GATT interfaces.
jksoft 1:48f6e08a3ac2 12 */
jksoft 1:48f6e08a3ac2 13
jksoft 1:48f6e08a3ac2 14 #ifndef BLE_GATT_H__
jksoft 1:48f6e08a3ac2 15 #define BLE_GATT_H__
jksoft 1:48f6e08a3ac2 16
jksoft 1:48f6e08a3ac2 17 #include "ble_types.h"
jksoft 1:48f6e08a3ac2 18 #include "ble_ranges.h"
jksoft 1:48f6e08a3ac2 19
jksoft 1:48f6e08a3ac2 20
jksoft 1:48f6e08a3ac2 21 /** @addtogroup BLE_GATT_DEFINES Defines
jksoft 1:48f6e08a3ac2 22 * @{ */
jksoft 1:48f6e08a3ac2 23
jksoft 1:48f6e08a3ac2 24 /** @brief Default MTU size. */
jksoft 1:48f6e08a3ac2 25 #define GATT_MTU_SIZE_DEFAULT 23
jksoft 1:48f6e08a3ac2 26
jksoft 1:48f6e08a3ac2 27 /** @brief Only the default MTU size of 23 is currently supported. */
jksoft 1:48f6e08a3ac2 28 #define GATT_RX_MTU 23
jksoft 1:48f6e08a3ac2 29
jksoft 1:48f6e08a3ac2 30
jksoft 1:48f6e08a3ac2 31 /**@brief Invalid Attribute Handle. */
jksoft 1:48f6e08a3ac2 32 #define BLE_GATT_HANDLE_INVALID 0x0000
jksoft 1:48f6e08a3ac2 33
jksoft 1:48f6e08a3ac2 34 /** @defgroup BLE_GATT_TIMEOUT_SOURCES GATT Timeout sources
jksoft 1:48f6e08a3ac2 35 * @{ */
jksoft 1:48f6e08a3ac2 36 #define BLE_GATT_TIMEOUT_SRC_PROTOCOL 0x00 /**< ATT Protocol timeout. */
jksoft 1:48f6e08a3ac2 37 /** @} */
jksoft 1:48f6e08a3ac2 38
jksoft 1:48f6e08a3ac2 39 /** @defgroup BLE_GATT_WRITE_OPS GATT Write operations
jksoft 1:48f6e08a3ac2 40 * @{ */
jksoft 1:48f6e08a3ac2 41 #define BLE_GATT_OP_INVALID 0x00 /**< Invalid Operation. */
jksoft 1:48f6e08a3ac2 42 #define BLE_GATT_OP_WRITE_REQ 0x01 /**< Write Request. */
jksoft 1:48f6e08a3ac2 43 #define BLE_GATT_OP_WRITE_CMD 0x02 /**< Write Command. */
jksoft 1:48f6e08a3ac2 44 #define BLE_GATT_OP_SIGN_WRITE_CMD 0x03 /**< Signed Write Command. */
jksoft 1:48f6e08a3ac2 45 #define BLE_GATT_OP_PREP_WRITE_REQ 0x04 /**< Prepare Write Request. */
jksoft 1:48f6e08a3ac2 46 #define BLE_GATT_OP_EXEC_WRITE_REQ 0x05 /**< Execute Write Request. */
jksoft 1:48f6e08a3ac2 47 /** @} */
jksoft 1:48f6e08a3ac2 48
jksoft 1:48f6e08a3ac2 49 /** @defgroup BLE_GATT_EXEC_WRITE_FLAGS GATT Execute Write flags
jksoft 1:48f6e08a3ac2 50 * @{ */
jksoft 1:48f6e08a3ac2 51 #define BLE_GATT_EXEC_WRITE_FLAG_PREPARED_CANCEL 0x00
jksoft 1:48f6e08a3ac2 52 #define BLE_GATT_EXEC_WRITE_FLAG_PREPARED_WRITE 0x01
jksoft 1:48f6e08a3ac2 53 /** @} */
jksoft 1:48f6e08a3ac2 54
jksoft 1:48f6e08a3ac2 55 /** @defgroup BLE_GATT_HVX_TYPES GATT Handle Value operations
jksoft 1:48f6e08a3ac2 56 * @{ */
jksoft 1:48f6e08a3ac2 57 #define BLE_GATT_HVX_INVALID 0x00 /**< Invalid Operation. */
jksoft 1:48f6e08a3ac2 58 #define BLE_GATT_HVX_NOTIFICATION 0x01 /**< Handle Value Notification. */
jksoft 1:48f6e08a3ac2 59 #define BLE_GATT_HVX_INDICATION 0x02 /**< Handle Value Indication. */
jksoft 1:48f6e08a3ac2 60 /** @} */
jksoft 1:48f6e08a3ac2 61
jksoft 1:48f6e08a3ac2 62 /** @defgroup BLE_GATT_STATUS_CODES GATT Status Codes
jksoft 1:48f6e08a3ac2 63 * @{ */
jksoft 1:48f6e08a3ac2 64 #define BLE_GATT_STATUS_SUCCESS 0x0000 /**< Success. */
jksoft 1:48f6e08a3ac2 65 #define BLE_GATT_STATUS_UNKNOWN 0x0001 /**< Unknown or not applicable status. */
jksoft 1:48f6e08a3ac2 66 #define BLE_GATT_STATUS_ATTERR_INVALID 0x0100 /**< ATT Error: Invalid Error Code. */
jksoft 1:48f6e08a3ac2 67 #define BLE_GATT_STATUS_ATTERR_INVALID_HANDLE 0x0101 /**< ATT Error: Invalid Attribute Handle. */
jksoft 1:48f6e08a3ac2 68 #define BLE_GATT_STATUS_ATTERR_READ_NOT_PERMITTED 0x0102 /**< ATT Error: Read not permitted. */
jksoft 1:48f6e08a3ac2 69 #define BLE_GATT_STATUS_ATTERR_WRITE_NOT_PERMITTED 0x0103 /**< ATT Error: Write not permitted. */
jksoft 1:48f6e08a3ac2 70 #define BLE_GATT_STATUS_ATTERR_INVALID_PDU 0x0104 /**< ATT Error: Used in ATT as Invalid PDU. */
jksoft 1:48f6e08a3ac2 71 #define BLE_GATT_STATUS_ATTERR_INSUF_AUTHENTICATION 0x0105 /**< ATT Error: Authenticated link required. */
jksoft 1:48f6e08a3ac2 72 #define BLE_GATT_STATUS_ATTERR_REQUEST_NOT_SUPPORTED 0x0106 /**< ATT Error: Used in ATT as Request Not Supported. */
jksoft 1:48f6e08a3ac2 73 #define BLE_GATT_STATUS_ATTERR_INVALID_OFFSET 0x0107 /**< ATT Error: Offset specified was past the end of the attribute. */
jksoft 1:48f6e08a3ac2 74 #define BLE_GATT_STATUS_ATTERR_INSUF_AUTHORIZATION 0x0108 /**< ATT Error: Used in ATT as Insufficient Authorisation. */
jksoft 1:48f6e08a3ac2 75 #define BLE_GATT_STATUS_ATTERR_PREPARE_QUEUE_FULL 0x0109 /**< ATT Error: Used in ATT as Prepare Queue Full. */
jksoft 1:48f6e08a3ac2 76 #define BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND 0x010A /**< ATT Error: Used in ATT as Attribute not found. */
jksoft 1:48f6e08a3ac2 77 #define BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_LONG 0x010B /**< ATT Error: Attribute cannot be read or written using read/write blob requests. */
jksoft 1:48f6e08a3ac2 78 #define BLE_GATT_STATUS_ATTERR_INSUF_ENC_KEY_SIZE 0x010C /**< ATT Error: Encryption key size used is insufficient. */
jksoft 1:48f6e08a3ac2 79 #define BLE_GATT_STATUS_ATTERR_INVALID_ATT_VAL_LENGTH 0x010D /**< ATT Error: Invalid value size. */
jksoft 1:48f6e08a3ac2 80 #define BLE_GATT_STATUS_ATTERR_UNLIKELY_ERROR 0x010E /**< ATT Error: Very unlikely error. */
jksoft 1:48f6e08a3ac2 81 #define BLE_GATT_STATUS_ATTERR_INSUF_ENCRYPTION 0x010F /**< ATT Error: Encrypted link required. */
jksoft 1:48f6e08a3ac2 82 #define BLE_GATT_STATUS_ATTERR_UNSUPPORTED_GROUP_TYPE 0x0110 /**< ATT Error: Attribute type is not a supported grouping attribute. */
jksoft 1:48f6e08a3ac2 83 #define BLE_GATT_STATUS_ATTERR_INSUF_RESOURCES 0x0111 /**< ATT Error: Encrypted link required. */
jksoft 1:48f6e08a3ac2 84 #define BLE_GATT_STATUS_ATTERR_RFU_RANGE1_BEGIN 0x0112 /**< ATT Error: Reserved for Future Use range #1 begin. */
jksoft 1:48f6e08a3ac2 85 #define BLE_GATT_STATUS_ATTERR_RFU_RANGE1_END 0x017F /**< ATT Error: Reserved for Future Use range #1 end. */
jksoft 1:48f6e08a3ac2 86 #define BLE_GATT_STATUS_ATTERR_APP_BEGIN 0x0180 /**< ATT Error: Application range begin. */
jksoft 1:48f6e08a3ac2 87 #define BLE_GATT_STATUS_ATTERR_APP_END 0x019F /**< ATT Error: Application range end. */
jksoft 1:48f6e08a3ac2 88 #define BLE_GATT_STATUS_ATTERR_RFU_RANGE2_BEGIN 0x01A0 /**< ATT Error: Reserved for Future Use range #2 begin. */
jksoft 1:48f6e08a3ac2 89 #define BLE_GATT_STATUS_ATTERR_RFU_RANGE2_END 0x01DF /**< ATT Error: Reserved for Future Use range #2 end. */
jksoft 1:48f6e08a3ac2 90 #define BLE_GATT_STATUS_ATTERR_RFU_RANGE3_BEGIN 0x01E0 /**< ATT Error: Reserved for Future Use range #3 begin. */
jksoft 1:48f6e08a3ac2 91 #define BLE_GATT_STATUS_ATTERR_RFU_RANGE3_END 0x01FC /**< ATT Error: Reserved for Future Use range #3 end. */
jksoft 1:48f6e08a3ac2 92 #define BLE_GATT_STATUS_ATTERR_CPS_CCCD_CONFIG_ERROR 0x01FD /**< ATT Common Profile and Service Error: Client Characteristic Configuration Descriptor improperly configured. */
jksoft 1:48f6e08a3ac2 93 #define BLE_GATT_STATUS_ATTERR_CPS_PROC_ALR_IN_PROG 0x01FE /**< ATT Common Profile and Service Error: Procedure Already in Progress. */
jksoft 1:48f6e08a3ac2 94 #define BLE_GATT_STATUS_ATTERR_CPS_OUT_OF_RANGE 0x01FF /**< ATT Common Profile and Service Error: Out Of Range. */
jksoft 1:48f6e08a3ac2 95 /** @} */
jksoft 1:48f6e08a3ac2 96
jksoft 1:48f6e08a3ac2 97
jksoft 1:48f6e08a3ac2 98 /** @defgroup BLE_GATT_CPF_FORMATS Characteristic Presentation Formats
jksoft 1:48f6e08a3ac2 99 * @note Found at http://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.characteristic_presentation_format.xml
jksoft 1:48f6e08a3ac2 100 * @{ */
jksoft 1:48f6e08a3ac2 101 #define BLE_GATT_CPF_FORMAT_RFU 0x00 /**< Reserved For Future Use. */
jksoft 1:48f6e08a3ac2 102 #define BLE_GATT_CPF_FORMAT_BOOLEAN 0x01 /**< Boolean. */
jksoft 1:48f6e08a3ac2 103 #define BLE_GATT_CPF_FORMAT_2BIT 0x02 /**< Unsigned 2-bit integer. */
jksoft 1:48f6e08a3ac2 104 #define BLE_GATT_CPF_FORMAT_NIBBLE 0x03 /**< Unsigned 4-bit integer. */
jksoft 1:48f6e08a3ac2 105 #define BLE_GATT_CPF_FORMAT_UINT8 0x04 /**< Unsigned 8-bit integer. */
jksoft 1:48f6e08a3ac2 106 #define BLE_GATT_CPF_FORMAT_UINT12 0x05 /**< Unsigned 12-bit integer. */
jksoft 1:48f6e08a3ac2 107 #define BLE_GATT_CPF_FORMAT_UINT16 0x06 /**< Unsigned 16-bit integer. */
jksoft 1:48f6e08a3ac2 108 #define BLE_GATT_CPF_FORMAT_UINT24 0x07 /**< Unsigned 24-bit integer. */
jksoft 1:48f6e08a3ac2 109 #define BLE_GATT_CPF_FORMAT_UINT32 0x08 /**< Unsigned 32-bit integer. */
jksoft 1:48f6e08a3ac2 110 #define BLE_GATT_CPF_FORMAT_UINT48 0x09 /**< Unsigned 48-bit integer. */
jksoft 1:48f6e08a3ac2 111 #define BLE_GATT_CPF_FORMAT_UINT64 0x0A /**< Unsigned 64-bit integer. */
jksoft 1:48f6e08a3ac2 112 #define BLE_GATT_CPF_FORMAT_UINT128 0x0B /**< Unsigned 128-bit integer. */
jksoft 1:48f6e08a3ac2 113 #define BLE_GATT_CPF_FORMAT_SINT8 0x0C /**< Signed 2-bit integer. */
jksoft 1:48f6e08a3ac2 114 #define BLE_GATT_CPF_FORMAT_SINT12 0x0D /**< Signed 12-bit integer. */
jksoft 1:48f6e08a3ac2 115 #define BLE_GATT_CPF_FORMAT_SINT16 0x0E /**< Signed 16-bit integer. */
jksoft 1:48f6e08a3ac2 116 #define BLE_GATT_CPF_FORMAT_SINT24 0x0F /**< Signed 24-bit integer. */
jksoft 1:48f6e08a3ac2 117 #define BLE_GATT_CPF_FORMAT_SINT32 0x10 /**< Signed 32-bit integer. */
jksoft 1:48f6e08a3ac2 118 #define BLE_GATT_CPF_FORMAT_SINT48 0x11 /**< Signed 48-bit integer. */
jksoft 1:48f6e08a3ac2 119 #define BLE_GATT_CPF_FORMAT_SINT64 0x12 /**< Signed 64-bit integer. */
jksoft 1:48f6e08a3ac2 120 #define BLE_GATT_CPF_FORMAT_SINT128 0x13 /**< Signed 128-bit integer. */
jksoft 1:48f6e08a3ac2 121 #define BLE_GATT_CPF_FORMAT_FLOAT32 0x14 /**< IEEE-754 32-bit floating point. */
jksoft 1:48f6e08a3ac2 122 #define BLE_GATT_CPF_FORMAT_FLOAT64 0x15 /**< IEEE-754 64-bit floating point. */
jksoft 1:48f6e08a3ac2 123 #define BLE_GATT_CPF_FORMAT_SFLOAT 0x16 /**< IEEE-11073 16-bit SFLOAT. */
jksoft 1:48f6e08a3ac2 124 #define BLE_GATT_CPF_FORMAT_FLOAT 0x17 /**< IEEE-11073 32-bit FLOAT. */
jksoft 1:48f6e08a3ac2 125 #define BLE_GATT_CPF_FORMAT_DUINT16 0x18 /**< IEEE-20601 format. */
jksoft 1:48f6e08a3ac2 126 #define BLE_GATT_CPF_FORMAT_UTF8S 0x19 /**< UTF-8 string. */
jksoft 1:48f6e08a3ac2 127 #define BLE_GATT_CPF_FORMAT_UTF16S 0x1A /**< UTF-16 string. */
jksoft 1:48f6e08a3ac2 128 #define BLE_GATT_CPF_FORMAT_STRUCT 0x1B /**< Opaque Structure. */
jksoft 1:48f6e08a3ac2 129 /** @} */
jksoft 1:48f6e08a3ac2 130
jksoft 1:48f6e08a3ac2 131 /** @defgroup BLE_GATT_CPF_NAMESPACES GATT Bluetooth Namespaces
jksoft 1:48f6e08a3ac2 132 * @{
jksoft 1:48f6e08a3ac2 133 */
jksoft 1:48f6e08a3ac2 134 #define BLE_GATT_CPF_NAMESPACE_BTSIG 0x01
jksoft 1:48f6e08a3ac2 135 #define BLE_GATT_CPF_NAMESPACE_DESCRIPTION_UNKNOWN 0x0000
jksoft 1:48f6e08a3ac2 136 /** @} */
jksoft 1:48f6e08a3ac2 137
jksoft 1:48f6e08a3ac2 138 /** @} */
jksoft 1:48f6e08a3ac2 139
jksoft 1:48f6e08a3ac2 140 /** @addtogroup BLE_GATT_STRUCTURES Structures
jksoft 1:48f6e08a3ac2 141 * @{ */
jksoft 1:48f6e08a3ac2 142
jksoft 1:48f6e08a3ac2 143 /**@brief GATT Characteristic Properties. */
jksoft 1:48f6e08a3ac2 144 typedef struct
jksoft 1:48f6e08a3ac2 145 {
jksoft 1:48f6e08a3ac2 146 /* Standard properties */
jksoft 1:48f6e08a3ac2 147 uint8_t broadcast :1; /**< Broadcasting of value permitted. */
jksoft 1:48f6e08a3ac2 148 uint8_t read :1; /**< Reading value permitted. */
jksoft 1:48f6e08a3ac2 149 uint8_t write_wo_resp :1; /**< Writing value with Write Command permitted. */
jksoft 1:48f6e08a3ac2 150 uint8_t write :1; /**< Writing value with Write Request permitted. */
jksoft 1:48f6e08a3ac2 151 uint8_t notify :1; /**< Notications of value permitted. */
jksoft 1:48f6e08a3ac2 152 uint8_t indicate :1; /**< Indications of value permitted. */
jksoft 1:48f6e08a3ac2 153 uint8_t auth_signed_wr :1; /**< Writing value with Signed Write Command permitted. */
jksoft 1:48f6e08a3ac2 154 } ble_gatt_char_props_t;
jksoft 1:48f6e08a3ac2 155
jksoft 1:48f6e08a3ac2 156 /**@brief GATT Characteristic Extended Properties. */
jksoft 1:48f6e08a3ac2 157 typedef struct
jksoft 1:48f6e08a3ac2 158 {
jksoft 1:48f6e08a3ac2 159 /* Extended properties */
jksoft 1:48f6e08a3ac2 160 uint8_t reliable_wr :1; /**< Writing value with Queued Write Request permitted. */
jksoft 1:48f6e08a3ac2 161 uint8_t wr_aux :1; /**< Writing the Characteristic User Description permitted. */
jksoft 1:48f6e08a3ac2 162 } ble_gatt_char_ext_props_t;
jksoft 1:48f6e08a3ac2 163
jksoft 1:48f6e08a3ac2 164 #endif // BLE_GATT_H__
jksoft 1:48f6e08a3ac2 165
jksoft 1:48f6e08a3ac2 166 /** @} */
jksoft 1:48f6e08a3ac2 167
jksoft 1:48f6e08a3ac2 168 /**
jksoft 1:48f6e08a3ac2 169 @}
jksoft 1:48f6e08a3ac2 170 @}
jksoft 1:48f6e08a3ac2 171 */