I'm using the nRF52840 express and Arduino IDE. My application is to be used outdoors or remotely. My problem is that it only pairs with iPad or iPhone when is pugged into my computer and running the IDE . It waits until I click on the serial monitor, the it pairs up and everything is OK. I'm only using the Button part of the example but does it even with the whole example.
Thanks, Pete
software problem with BLE controller example
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- peterprbrtsn
- Posts: 5
- Joined: Tue Aug 22, 2017 2:13 pm
- adafruit_support_mike
- Posts: 67485
- Joined: Thu Feb 11, 2010 2:51 pm
Re: software problem with BLE controller example
Check your setup() function for something like this:
It takes the microcontroller a few milliseconds to set up a USB Serial connection with the computer and initialize a Serial object. The code in setup() can run within microseconds of the chip booting though, and function calls like Serial.begin() fail silently if the Serial object hasn't been initialized yet. The code above makes sure you have a working Serial interface with the computer before it runs any more of your code.
When you unplug the board from the computer, it becomes impossible to create a Serial object, and the line above will hang forever. That's a common gotcha when using chips that handle USB internally.
Code: Select all
while ( ! Serial ) { delay( 1 ); }
When you unplug the board from the computer, it becomes impossible to create a Serial object, and the line above will hang forever. That's a common gotcha when using chips that handle USB internally.
Please be positive and constructive with your questions and comments.