Skip to content

Commit 05402c4

Browse files
authored
fix(matter): example shall set digital mode before writing
1 parent 94b43d8 commit 05402c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/Matter/examples/MatterEnhancedColorLight/MatterEnhancedColorLight.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ bool setLightState(bool state, espHsvColor_t colorHSV, uint8_t brighteness, uint
6464
analogWrite(ledPin, colorHSV.v);
6565
#endif
6666
} else {
67+
#ifndef RGB_BUILTIN
68+
// after analogWrite(), it is necessary to set the GPIO to digital mode first
69+
pinMode(ledPin, OUTPUT);
70+
#endif
6771
digitalWrite(ledPin, LOW);
6872
}
6973
// store last HSV Color and OnOff state for when the Light is restarted / power goes off

0 commit comments

Comments
 (0)