#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); }
更多: