Skip to content

Commit 4d18a8c

Browse files
committed
Update Zigbee examples with new APIs
1 parent db01086 commit 4d18a8c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

libraries/Zigbee/examples/Zigbee_Color_Dimmable_Light/Zigbee_Color_Dimmable_Light.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public:
4646
// Override the set_on_off function
4747
void setOnOff(bool value) override {
4848
if (value == false) {
49-
neopixelWrite(LED_PIN, 0, 0, 0); // Turn off light
49+
rgbLedWrite(LED_PIN, 0, 0, 0); // Turn off light
5050
} else {
5151
updateLight(); // Turn on light on last color and level
5252
}
@@ -55,7 +55,7 @@ public:
5555
// Override the set_level function
5656
void setLevel(uint8_t level) override {
5757
if (level == 0) {
58-
neopixelWrite(LED_PIN, 0, 0, 0); // Turn off light and dont update ratio
58+
rgbLedWrite(LED_PIN, 0, 0, 0); // Turn off light and dont update ratio
5959
return;
6060
}
6161
_ratio = (float)level / 255;
@@ -71,7 +71,7 @@ public:
7171
}
7272

7373
void updateLight() {
74-
neopixelWrite(LED_PIN, _red * _ratio, _green * _ratio, _blue * _ratio); // Update light
74+
rgbLedWrite(LED_PIN, _red * _ratio, _green * _ratio, _blue * _ratio); // Update light
7575
}
7676
private:
7777
// Add your custom attributes and methods here
@@ -87,7 +87,7 @@ MyZigbeeColorLight zbColorLight = MyZigbeeColorLight(ZIGBEE_LIGHT_ENDPOINT);
8787
/********************* Arduino functions **************************/
8888
void setup() {
8989
// Init RMT and leave light OFF
90-
neopixelWrite(LED_PIN, 0, 0, 0);
90+
rgbLedWrite(LED_PIN, 0, 0, 0);
9191

9292
// Init button for factory reset
9393
pinMode(BUTTON_PIN, INPUT);

libraries/Zigbee/examples/Zigbee_Color_Dimmer_Switch/Zigbee_Color_Dimmer_Switch.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ void loop() {
137137
}
138138
}
139139

140-
// print the bound lights every 30 seconds
140+
// print the bound devices (lights) every 30 seconds
141141
static uint32_t last_print = 0;
142142
if (millis() - last_print > 30000) {
143143
last_print = millis();
144-
zbSwitch.printBoundLights();
144+
zbSwitch.printBoundDevices();
145145
}
146146
}

libraries/Zigbee/examples/Zigbee_On_Off_Light/Zigbee_On_Off_Light.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public:
4444

4545
// Override the set_on_off function
4646
void setOnOff(bool value) override {
47-
neopixelWrite(LED_PIN, 255 * value, 255 * value, 255 * value); // Toggle light
47+
rgbLedWrite(LED_PIN, 255 * value, 255 * value, 255 * value); // Toggle light
4848
}
4949
};
5050

@@ -53,7 +53,7 @@ MyZigbeeLight zbLight = MyZigbeeLight(ZIGBEE_LIGHT_ENDPOINT);
5353
/********************* Arduino functions **************************/
5454
void setup() {
5555
// Init RMT and leave light OFF
56-
neopixelWrite(LED_PIN, 0, 0, 0);
56+
rgbLedWrite(LED_PIN, 0, 0, 0);
5757

5858
// Init button for factory reset
5959
pinMode(BUTTON_PIN, INPUT);

libraries/Zigbee/examples/Zigbee_Temperature_Sensor/Zigbee_Temperature_Sensor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
#include "ep/ep_temperature_sensor.h"
3535

3636
#define BUTTON_PIN 9 //Boot button for C6/H2
37-
3837
#define TEMP_SENSOR_ENDPOINT_NUMBER 10
38+
3939
ZigbeeTempSensor zbTempSensor = ZigbeeTempSensor(TEMP_SENSOR_ENDPOINT_NUMBER);
4040

4141
/************************ Temp sensor *****************************/

0 commit comments

Comments
 (0)