Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6e56936

Browse filesBrowse files
committed
Use gpio calls for OnOff Light example
1 parent 3198de3 commit 6e56936
Copy full SHA for 6e56936

File tree

Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed

‎libraries/Zigbee/examples/Zigbee_On_Off_Light/Zigbee_On_Off_Light.ino

Copy file name to clipboardExpand all lines: libraries/Zigbee/examples/Zigbee_On_Off_Light/Zigbee_On_Off_Light.ino
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ ZigbeeLight zbLight = ZigbeeLight(ZIGBEE_LIGHT_ENDPOINT);
4141

4242
/********************* RGB LED functions **************************/
4343
void setLED(bool value) {
44-
rgbLedWrite(LED_PIN, 255 * value, 255 * value, 255 * value);
44+
digitalWrite(LED_PIN, value);
4545
}
4646

4747
/********************* Arduino functions **************************/
4848
void setup() {
49-
// Init RMT and leave light OFF
50-
rgbLedWrite(LED_PIN, 0, 0, 0);
49+
// Init LED and turn it OFF (if LED_PIN == RGB_BUILTIN, the rgbLedWrite() will be used under the hood)
50+
pinMode(LED_PIN, OUTPUT);
51+
digitalWrite(LED_PIN, LOW);
5152

5253
// Init button for factory reset
5354
pinMode(BUTTON_PIN, INPUT);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.