Skip to content

Commit

Permalink
Use gpio calls for OnOff Light example
Browse files Browse the repository at this point in the history
  • Loading branch information
P-R-O-C-H-Y committed Sep 27, 2024
1 parent 3198de3 commit f41a01e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ ZigbeeLight zbLight = ZigbeeLight(ZIGBEE_LIGHT_ENDPOINT);

/********************* RGB LED functions **************************/
void setLED(bool value) {
rgbLedWrite(LED_PIN, 255 * value, 255 * value, 255 * value);
digitalWrite(LED_PIN, value);
}

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

// Init button for factory reset
pinMode(BUTTON_PIN, INPUT);
Expand Down

0 comments on commit f41a01e

Please sign in to comment.