15
15
/* *
16
16
* @brief This example demonstrates Zigbee Color Dimmable light bulb.
17
17
*
18
- * The example demonstrates how to use Zigbee library to create an end device with
18
+ * The example demonstrates how to use Zigbee library to create an end device with
19
19
* color dimmable light end point.
20
20
* The light bulb is a Zigbee end device, which is controlled by a Zigbee coordinator.
21
21
*
22
22
* Proper Zigbee mode must be selected in Tools->Zigbee mode
23
23
* and also the correct partition scheme must be selected in Tools->Partition Scheme.
24
24
*
25
25
* Please check the README.md for instructions and more detailed description.
26
- *
26
+ *
27
27
* Created by Jan Procházka (https://github.com/P-R-O-C-H-Y/)
28
28
*/
29
29
34
34
#include " ZigbeeCore.h"
35
35
#include " ep/ZigbeeColorDimmableLight.h"
36
36
37
- #define LED_PIN RGB_BUILTIN
38
- #define BUTTON_PIN 9 // C6/H2 Boot button
39
- #define ZIGBEE_LIGHT_ENDPOINT 10
37
+ #define LED_PIN RGB_BUILTIN
38
+ #define BUTTON_PIN 9 // C6/H2 Boot button
39
+ #define ZIGBEE_LIGHT_ENDPOINT 10
40
40
41
41
ZigbeeColorDimmableLight zbColorLight = ZigbeeColorDimmableLight(ZIGBEE_LIGHT_ENDPOINT);
42
42
@@ -52,7 +52,7 @@ void identify(uint16_t time) {
52
52
log_d (" Identify called for %d seconds" , time );
53
53
if (time == 0 ) {
54
54
// If identify time is 0, stop blinking and restore light as it was used for identify
55
- zbColorLight.restoreLight ();
55
+ zbColorLight.restoreLight ();
56
56
return ;
57
57
}
58
58
rgbLedWrite (LED_PIN, 255 * blink, 255 * blink, 255 * blink);
@@ -79,7 +79,7 @@ void setup() {
79
79
// Add endpoint to Zigbee Core
80
80
log_d (" Adding ZigbeeLight endpoint to Zigbee Core" );
81
81
Zigbee.addEndpoint (&zbColorLight);
82
-
82
+
83
83
// When all EPs are registered, start Zigbee. By default acts as ZIGBEE_END_DEVICE
84
84
log_d (" Calling Zigbee.begin()" );
85
85
Zigbee.begin ();
@@ -93,12 +93,12 @@ void loop() {
93
93
int startTime = millis ();
94
94
while (digitalRead (BUTTON_PIN) == LOW) {
95
95
delay (50 );
96
- if ((millis () - startTime) > 3000 ) {
96
+ if ((millis () - startTime) > 3000 ) {
97
97
// If key pressed for more than 3secs, factory reset Zigbee and reboot
98
98
Serial.printf (" Reseting Zigbee to factory settings, reboot.\n " );
99
99
Zigbee.factoryReset ();
100
100
}
101
101
}
102
102
}
103
103
delay (100 );
104
- }
104
+ }
0 commit comments