File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,7 +30,11 @@ void setup() {
3030 pinMode (buttonPin, INPUT);
3131
3232 // initialize the Bluetooth® Low Energy hardware
33- BLE.begin ();
33+ if (!BLE.begin ()) {
34+ Serial.println (" starting Bluetooth® Low Energy module failed!" );
35+
36+ while (1 );
37+ }
3438
3539 Serial.println (" Bluetooth® Low Energy Central - LED control" );
3640
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ void setup() {
1212 while (!Serial);
1313
1414 if (!BLE.begin ()) {
15- Serial.println (" failed to initialize BLE!" );
15+ Serial.println (" starting Bluetooth® Low Energy module failed!" );
16+
1617 while (1 );
1718 }
1819
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ void setup() {
1111 while (!Serial);
1212
1313 if (!BLE.begin ()) {
14- Serial.println (" failed to initialize BLE!" );
14+ Serial.println (" starting Bluetooth® Low Energy module failed!" );
15+
1516 while (1 );
1617 }
1718
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ void setup() {
3535
3636 // begin initialization
3737 if (!BLE.begin ()) {
38- Serial.println (" starting BLE failed!" );
38+ Serial.println (" starting Bluetooth® Low Energy module failed!" );
3939
4040 while (1 );
4141 }
Original file line number Diff line number Diff line change @@ -154,9 +154,9 @@ void setup() {
154154 while (1 ){
155155 // begin initialization
156156 if (!BLE.begin ()) {
157- Serial.println (" starting BLE failed!" );
158- delay ( 200 );
159- continue ;
157+ Serial.println (" starting Bluetooth® Low Energy module failed!" );
158+
159+ while ( 1 ) ;
160160 }
161161 Serial.println (" BT init" );
162162 delay (200 );
You can’t perform that action at this time.
0 commit comments