Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
pre-release ([pybricks-micropython#425]).
- Fixed internal rounding error that could could cause a Drive Base to be 1 mm
off after driving 3 meters, depending on configuration parameters ([support#2500]).

- Fixed Powered Up remote light getting the wrong color ([support#2497]).

[support#1962]: https://github.com/pybricks/support/issues/1962
[support#2468]: https://github.com/pybricks/support/issues/2468
[support#2497]: https://github.com/pybricks/support/issues/2497
[support#2500]: https://github.com/pybricks/support/issues/2500
[pybricks-micropython#405]: https://github.com/pybricks/pybricks-micropython/pull/405
[pybricks-micropython#421]: https://github.com/pybricks/pybricks-micropython/pull/421
Expand Down
9 changes: 6 additions & 3 deletions pybricks/iodevices/pb_type_iodevices_lwp3device.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,15 @@ static pbio_error_t pb_type_pupdevices_Remote_write_light_msg(mp_obj_t self_in,
.cmd = LWP3_OUTPUT_CMD_WRITE_DIRECT_MODE_DATA,
.mode = STATUS_LIGHT_MODE_RGB_0,
};
pbio_color_hsv_to_rgb(hsv, (pbio_color_rgb_t *)msg.payload);

pbio_color_rgb_t rgb;
pbio_color_hsv_to_rgb(hsv, &rgb);

// The red LED on the handset is weak, so we have to reduce green and blue
// to get the colors right.
msg.payload[1] = msg.payload[1] * 3 / 8;
msg.payload[2] = msg.payload[2] * 3 / 8;
msg.payload[0] = rgb.r;
msg.payload[1] = rgb.g * 3 / 8;
msg.payload[2] = rgb.b * 3 / 8;

return pbdrv_bluetooth_peripheral_write_characteristic(pb_lwp3device_char.handle, (const uint8_t *)&msg, sizeof(msg));
}
Expand Down