5
5
* need a unique ble local name (see below). If you are using another supported BLE board or shield,
6
6
* follow the instructions for the specific board or shield below.
7
7
*
8
- * Make sure you have the Intel Curie Boards package v1 .0.6 or higher installed via the Arduino
8
+ * Make sure you have the Intel Curie Boards package v2 .0.2 or higher installed via the Arduino
9
9
* Boards Manager.
10
10
*
11
11
* Supported boards and shields:
19
19
// within the same physical space
20
20
#define FIRMATA_BLE_LOCAL_NAME "FIRMATA"
21
21
22
+ /*
23
+ * Arduino 101
24
+ *
25
+ * Make sure you have the Intel Curie Boards package v2.0.2 or higher installed via the Arduino
26
+ * Boards Manager.
27
+ *
28
+ * Test script: https://gist.github.com/soundanalogous/927360b797574ed50e27
29
+ */
30
+ #ifdef _VARIANT_ARDUINO_101_X_
31
+ // After conversion to units of 1.25ms, both values must be between
32
+ // 0x0006 (7.5ms) and 0x0c80 (4s)
33
+ #define FIRMATA_BLE_MIN_INTERVAL 8 // ( 8 * 1000) / 1250 == 0x06 -> 7.5ms
34
+ #define FIRMATA_BLE_MAX_INTERVAL 30 // (30 * 1000) / 1250 == 0x18 -> 30ms
35
+ #endif
36
+
37
+
22
38
/*
23
39
* RedBearLab BLE Shield
24
40
*
36
52
//#define REDBEAR_BLE_SHIELD
37
53
38
54
#ifdef REDBEAR_BLE_SHIELD
39
- #include <SPI.h>
40
- #include <BLEPeripheral.h>
41
- #include "utility/BLEStream.h"
42
-
43
55
#define BLE_REQ 9
44
56
#define BLE_RDY 8
45
57
#define BLE_RST 4 // 4 or 7 via jumper on shield
58
+ #endif
46
59
47
- BLEStream stream (BLE_REQ , BLE_RDY , BLE_RST );
60
+
61
+ /*
62
+ * Generic settings
63
+ */
64
+ #if !defined(FIRMATA_BLE_MIN_INTERVAL ) && !defined(FIRMATA_BLE_MAX_INTERVAL )
65
+ // BLE connection interval - this is the fastest interval you can read inputs.
66
+ // These values apply to all devices using the Arduino BLEPeripheral library
67
+ // with a Nordic nRF8001 or nRF51822. Both values must be between
68
+ // 0x0006 (7.5ms) and 0x0c80 (4s).
69
+ #define FIRMATA_BLE_MIN_INTERVAL 0x0006 // 7.5ms (7.5 / 1.25)
70
+ #define FIRMATA_BLE_MAX_INTERVAL 0x0018 // 30ms (30 / 1.25)
71
+ #endif
72
+
73
+ #if !defined(FIRMATA_BLE_TXBUFFER_FLUSH_INTERVAL )
74
+ // How often the BLE TX buffer is flushed (if not full)
75
+ #define FIRMATA_BLE_TXBUFFER_FLUSH_INTERVAL 30 // 30ms
48
76
#endif
49
77
50
78
51
79
/*==================================================================================================
52
80
* END BLE CONFIGURATION - you should not need to change anything below this line
53
81
*================================================================================================*/
54
82
55
- /*
56
- * Arduino 101
57
- *
58
- * Make sure you have the Intel Curie Boards package v1.0.6 or higher installed via the Arduino
59
- * Boards Manager.
60
- *
61
- * Test script: https://gist.github.com/soundanalogous/927360b797574ed50e27
62
- */
63
83
#ifdef _VARIANT_ARDUINO_101_X_
64
- #include <CurieBLE.h>
65
84
#include "utility/BLEStream.h"
66
85
BLEStream stream ;
67
86
#endif
68
87
69
88
89
+ #ifdef REDBEAR_BLE_SHIELD
90
+ #include <SPI.h>
91
+ #include "utility/BLEStream.h"
92
+ BLEStream stream (BLE_REQ , BLE_RDY , BLE_RST );
93
+ #endif
94
+
95
+
70
96
/*
71
97
* RedBearLab BLE Nano (with default switch settings)
72
98
*
@@ -81,7 +107,6 @@ BLEStream stream;
81
107
* the pins are currently mapped in Firmata only for the default (factory) jumper settings.
82
108
*/
83
109
// #ifdef BLE_NANO
84
- // #include <BLEPeripheral.h>
85
110
// #include "utility/BLEStream.h"
86
111
// BLEStream stream;
87
112
// #endif
@@ -96,7 +121,6 @@ BLEStream stream;
96
121
*/
97
122
// #if defined(BLEND_MICRO) || defined(BLEND)
98
123
// #include <SPI.h>
99
- // #include <BLEPeripheral.h>
100
124
// #include "utility/BLEStream.h"
101
125
102
126
// #define BLE_REQ 6
0 commit comments