Skip to content

Commit 0f3490a

Browse files
authored
fix(matter): itshall set digital mode before digitalWrite
1 parent 4677ea6 commit 0f3490a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libraries/Matter/examples/MatterColorLight/MatterColorLight.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ bool setLightState(bool state, espHsvColor_t colorHSV) {
6060
analogWrite(ledPin, colorHSV.v);
6161
#endif
6262
} else {
63+
#ifndef RGB_BUILTIN
64+
// after analogWrite(), it is necessary to set the GPIO to digital mode first
65+
pinMode(ledPin, OUTPUT);
66+
#endif
6367
digitalWrite(ledPin, LOW);
6468
}
6569
// store last HSV Color and OnOff state for when the Light is restarted / power goes off

0 commit comments

Comments
 (0)