BLEPeripheral.h and MySensors.h libraries

Dear Arduino,

I am using BLEPeripheral.h , MySensors.h library and nRF51822 evolution kit device,
I want functionality like if I press the key of an nRF51822 device should start to advertise otherwise connect to another device (nodeMCU and nRF24L01) which is act as a gateway.

Here MySensors.h is working fine but BLEPeripheral.h is not working means device is not advertising.

I tried both libraries separately it is working fine.

please help me

Thank you

You have some libraries that you did not post links to. You are using them in some code you didn't post, running on hardware that you did not fully describe (with links). The code does something that you did not describe. You expect it to do something, but were not clear in describing what that was.

please help me

Doesn't seem likely, yet.

I used this arduino-BLEPeripheral/led.ino at master · sandeepmistry/arduino-BLEPeripheral · GitHub for advertising of nRf 51822 (Waveshare CC2530 Development Board ZigBee Module w/ Serial Port - Free shipping - DealExtreme) her I gave condition like if press the button then device will able to connect with central device like to the nRF connect tools app (https://play.google.com/store/apps/details?id=no.nordicsemi.android.mcp&hl=en) it is working fine
MySensor program is here attached with MySensors name, this is also working fine, then I added both programs like I want switch functionality attached file name "added". this program is compiled and uploaded successfully even attached with a gateway (nodeMCU and nRF24L01) but not advertising
gateway side MySensors/GatewayESP8266MQTTClient.ino at development · mysensors/MySensors · GitHub

MySensors.txt (5.08 KB)

added.txt (5.07 KB)

const int ledPin = 0; // pin to use for the LED

  Serial.begin(115200);

So, you attached an LED to the hardware serial pin, and that caused problems. I'm not at all surprised.

Is it possible advertisement will affect by pin connection? because when same code part I tried separately it is working fine.

When you disrupt serial communications by using one of the hardware serial pins for some other purpose, you have NO way of knowing what the program is doing. So, you can draw NO conclusions about what is, or is not, happening. GET THAT LED OFF THE HARDWARE SERIAL PIN!

I changed the pin number to 19, still getting the same problem, I am getting your point but I don't know how to resolve the issue. thanks for your reply and your valuable time.