Skip to content

Commit 4e4477d

Browse files
committed
feat(matter): improves the example
1 parent ac71355 commit 4e4477d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

libraries/Matter/examples/MatterWindowCovering/MatterWindowCovering.ino

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const uint16_t MIN_LIFT = 0; // Minimum lift position (fully closed)
5252

5353
// Tilt limits (absolute values for conversion, not physical units)
5454
// Tilt is a rotation, not a linear measurement
55-
const uint16_t MAX_TILT = 40; // Maximum tilt absolute value
55+
const uint16_t MAX_TILT = 90; // Maximum tilt absolute value
5656
const uint16_t MIN_TILT = 0; // Minimum tilt absolute value
5757

5858
// Current window covering state
@@ -73,12 +73,11 @@ const uint8_t ledPin = 2; // Set your pin here if your board has not defined RG
7373
void visualizeWindowBlinds(uint8_t liftPercent, uint8_t tiltPercent) {
7474
// Use RGB LED to visualize lift position (brightness) and tilt (color shift)
7575
float brightness = (float)liftPercent / 100.0; // 0.0 to 1.0
76+
#ifdef RGB_BUILTIN
7677
// Tilt affects color: 0% = red, 100% = blue
7778
uint8_t red = (uint8_t)(map(tiltPercent, 0, 100, 255, 0) * brightness);
7879
uint8_t blue = (uint8_t)(map(tiltPercent, 0, 100, 0, 255) * brightness);
7980
uint8_t green = 0;
80-
81-
#ifdef RGB_BUILTIN
8281
rgbLedWrite(ledPin, red, green, blue);
8382
#else
8483
// For non-RGB boards, just use brightness

0 commit comments

Comments
 (0)