灯灯提供的101 BLE广播例程

945
#include <CurieBLE.h>

BLEService broadcastService("");
BLEUnsignedShortCharacteristic broadcastChar("1234", BLEBroadcast);

void setup() {
  BLE.begin();
  BLE.setLocalName("Arduino 101");
  broadcastChar.broadcast();
  broadcastService.addCharacteristic(broadcastChar);
  BLE.addService(broadcastService);
}

void loop() {
  static unsigned short i = 0;
  broadcastChar.writeValue(i++);
  delay(1000);
}

 

 

更多:

http://www.arduino.cn/thread-45640-1-1.html

留下一个答复

Please enter your comment!
Please enter your name here