Skip to content

Commit 72851eb

Browse files
committed
feat(matter): make it work with rgb and analog led
1 parent afbcfe6 commit 72851eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/Matter/examples/MatterDimmableLight/MatterDimmableLight.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ const char *password = "your-password"; // Change this to your WiFi password
4444
bool setRGBLight(bool state, uint8_t brightness) {
4545
Serial.printf("Setting Light to State: %s and Brightness: %d\r\n", DimmableLight ? "ON" : "OFF", brightness);
4646
if (state) {
47+
#ifdef RGB_BUILTIN
4748
rgbLedWrite(ledPin, brightness, brightness, brightness);
49+
#else
50+
analogWrite(ledPin, brightness);
51+
#endif
4852
} else {
4953
digitalWrite(ledPin, LOW);
5054
}

0 commit comments

Comments
 (0)