#include BLEService testService("12345678-1234-1234-1234-1234567890ab"); BLEByteCharacteristic testChar( "87654321-4321-4321-4321-ba0987654321", BLERead | BLENotify ); uint8_t counter = 1; unsigned long lastSend = 0; void setup() { Serial.begin(115200); BLE.begin(); BLE.setLocalName("NiclaBLETest"); BLE.setAdvertisedService(testService); testService.addCharacteristic(testChar); BLE.addService(testService); testChar.writeValue((byte)0x00); BLE.advertise(); Serial.println("BLE Test Advertised"); } void loop() { BLE.poll(); BLEDevice central = BLE.central(); if (!central || !central.connected()) return; if (millis() - lastSend > 1000) { lastSend = millis(); testChar.writeValue(counter); Serial.print("Sent: 0x"); Serial.println(counter, HEX); counter++; } }