Skip to content

Commit 94b43d8

Browse files
authored
fix(matter): example must set pin in digital mode before writting
1 parent 0f3490a commit 94b43d8

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
@@ -56,6 +56,10 @@ bool setLightState(bool state, uint8_t brightness) {
5656
analogWrite(ledPin, brightness);
5757
#endif
5858
} else {
59+
#ifndef RGB_BUILTIN
60+
// after analogWrite(), it is necessary to set the GPIO to digital mode first
61+
pinMode(ledPin, OUTPUT);
62+
#endif
5963
digitalWrite(ledPin, LOW);
6064
}
6165
// store last Brightness and OnOff state for when the Light is restarted / power goes off

0 commit comments

Comments
 (0)