File tree 1 file changed +31
-0
lines changed
libraries/CurieBLE/examples/peripheral/broadcast
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include < CurieBLE.h>
2
+
3
+ uint8_t value = 0 ;
4
+
5
+ BLEPeripheral peripheral;
6
+ BLEService service = BLEService(" EEE0" );
7
+ BLEShortCharacteristic characteristic = BLEShortCharacteristic(" EEE1" , BLERead | BLENotify | BLEBroadcast);
8
+
9
+ void setup () {
10
+ Serial.begin (9600 );
11
+
12
+ peripheral.setLocalName (" BLEBroadcast" );
13
+ peripheral.setAdvertisedServiceUuid (service.uuid ());
14
+
15
+ peripheral.addAttribute (service);
16
+ peripheral.addAttribute (characteristic);
17
+
18
+ characteristic.setValue (value);
19
+
20
+ peripheral.begin ();
21
+ characteristic.broadcast ();
22
+
23
+ Serial.println (F (" BLE Broadcast Count" ));
24
+ }
25
+
26
+ void loop () {
27
+ peripheral.poll ();
28
+ characteristic.setValue (value);
29
+ delay (1000 );
30
+ value++;
31
+ }
You can’t perform that action at this time.
0 commit comments