// Define a simple GATT service with only 1 characteristic LBLEService servoService("19B10010-E8F2-537E-4F6C-D104768A1214"); LBLECharacteristicInt positionCharacteristic("19B10011-E8F2-537E-4F6C-D104768A1214", LBLE_READ | LBLE_WRITE);
void setup() {
//Initialize serial and wait for port to open: Serial.begin(9600);
// to check if USR button is pressed pinMode(6, INPUT);
// configure our advertisement data. // In this case, we simply create an advertisement that represents an // connectable device with a device name LBLEAdvertisementData advertisement; advertisement.configAsConnectableDevice("BLE Servo");
// Configure our device's Generic Access Profile's device name // Ususally this is the same as the name in the advertisement data. LBLEPeripheral.setName("BLE Servo");
// Add characteristics into servoService servoService.addAttribute(positionCharacteristic);
// Add service to GATT server (peripheral) LBLEPeripheral.addService(servoService);
// start the GATT server - it is now // available to connect LBLEPeripheral.begin();