Skip to content

Commit 8ee6a02

Browse files
hbisbysandeepmistry
authored andcommitted
variable name changed from switchCharacteristic to ledCharacteristic
1 parent e0139b6 commit 8ee6a02

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

libraries/CurieBle/examples/ButtonLED/ButtonLED.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ BleService ledService("19B10010-E8F2-537E-4F6C-D104768A1214"); // create service
2828

2929

3030
// create switch characteristic and allow remote device to read and write
31-
BleCharCharacteristic switchCharacteristic("19B10011-E8F2-537E-4F6C-D104768A1214", BleRead | BleWrite);
31+
BleCharCharacteristic ledCharacteristic("19B10011-E8F2-537E-4F6C-D104768A1214", BleRead | BleWrite);
3232
// create button characteristic and allow remote device to get notifications
3333
BleCharCharacteristic buttonCharacteristic("19B10012-E8F2-537E-4F6C-D104768A1214", BleRead | BleNotify); // allows remote device to get notifications
3434

@@ -38,13 +38,13 @@ void setup() {
3838
pinMode(buttonPin, INPUT); // use button pin 4 as an input
3939

4040
// set a name for the BLE peripheral. Max length is 20 characters:
41-
blePeripheral.setLocalName("Curie LED_Switch Sketch");
41+
blePeripheral.setLocalName("Curie ButtonLed Sketch");
4242
// set the UUID for the service this peripheral advertises:
4343
blePeripheral.setAdvertisedServiceUuid(ledService.uuid());
4444

4545
// add service and characteristics
4646
blePeripheral.addAttribute(ledService);
47-
blePeripheral.addAttribute(switchCharacteristic);
47+
blePeripheral.addAttribute(ledCharacteristic);
4848
blePeripheral.addAttribute(buttonCharacteristic);
4949

5050
// advertise the service
@@ -65,13 +65,13 @@ void loop() {
6565

6666
if (buttonChanged) {
6767
// button state changed, update characteristics
68-
switchCharacteristic.setValue(buttonValue);
68+
ledCharacteristic.setValue(buttonValue);
6969
buttonCharacteristic.setValue(buttonValue);
7070
}
7171

72-
if (switchCharacteristic.written() || buttonChanged) {
72+
if (ledCharacteristic.written() || buttonChanged) {
7373
// update LED, either central has written to characteristic or button state has changed
74-
if (switchCharacteristic.value()) {
74+
if (ledCharacteristic.value()) {
7575
Serial.println("LED on");
7676
digitalWrite(ledPin, HIGH);
7777
} else {

0 commit comments

Comments
 (0)