XIAO 8-9-24 Sketch include // Theses are the BLE UUIDs BLEService LEDService("f4b3c654-39f9-423a-8639-53010dc4301c"); //Service UUID hexadecimal numbers BLEIntCharacteristic redCharacteristic("bc776cf6-50d7-41cf-9999-55df941b2b9d", BLERead | BLEWrite | BLENotify); BLEIntCharacteristic greenCharacteristic("d3c69083-8afc-46d1-bd5a-fcca8893e7b2", BLERead | BLEWrite | BLENotify); BLEIntCharacteristic blueCharacteristic("9e2d6c3f-98ea-4e7d-95ad-2b8a88fbf97a", BLERead | BLEWrite | BLENotify); const int redPIN = LEDR; //pin to use for the red LED (D11) const int greenPIN = LEDG; //pin to use for the green LED (D12) const int bluePIN = LEDB; //pin to use for the red LED (D13) void setup() { pinMode(redPIN, OUTPUT); //set pins as outputs and set LED's HiGH ( HIGH is off for this board) digitalWrite(redPIN, HIGH); pinMode(greenPIN, OUTPUT); digitalWrite(greenPIN, HIGH); pinMode(bluePIN, OUTPUT); digitalWrite(bluePIN, HIGH); if (!BLE.begin()) { // begin initialization while (1) ; // wait until initialization is complete } BLE.setLocalName("BLE_RGB"); // set advertised local name BLE.setAdvertisedService(LEDService); // set advertised service UUID LEDService.addCharacteristic(redCharacteristic); // add the red characteristic to the service LEDService.addCharacteristic(greenCharacteristic); // add the green characteristic to the service LEDService.addCharacteristic(blueCharacteristic); // add the blue characteristic to the service BLE.addService(LEDService); // add service BLE.advertise(); // start advertising } void loop() { BLEDevice central = BLE.central(); // listen for BLE devices to connect: Not sure that this works for ESP32 if (central) { // if a central is connected to peripheral // put code here to perform 1 time when device is connected while (central.connected()) { // While the central is still connected to peripheral // if there is an update from the Android App, change light ON (0) or OFF (1) if (redCharacteristic.written()) digitalWrite(redPIN, redCharacteristic.value()); if (greenCharacteristic.written()) digitalWrite(greenPIN, greenCharacteristic.value()); if (blueCharacteristic.written()) digitalWrite(bluePIN, blueCharacteristic.value()); } // end of while loop } // you can put code here for what to do when not conected } // end of loop