Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New RGB Lighting effect: Twinkle #8887

Merged
merged 6 commits into from
May 9, 2020
Merged

Conversation

spidey3
Copy link
Contributor

@spidey3 spidey3 commented Apr 23, 2020

Description

This change adds a new RGB Lighting effect: Twinkle.

In this mode, underglow LEDs are selected pseudo-randomly to get brighter, and then get darker, over a set period. The result is a twinkling effect.

Configuration

  • There are six sub-modes:
    0: Monochromatic slow
    1: Monochromatic medium
    2: Monochromatic fast
    3: Multi-color slow
    4: Multi-color medium
    5: Multi-color fast
  • Saturation and value (brightness) can be set by the user in all sub-modes.
  • In monochromatic sub-modes, hue can be set by the user.
  • In multi-color modes, hue is selected pseudo-randomly for each LED.

If you have Velocikey enabled, it will affect the animation speed.

Implementation

I have tried to keep the increase in code size due to this animation as low as possible, but it does cause an increase in firmware size of about 800 bytes.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@drashna drashna requested a review from a team April 23, 2020 20:31
Copy link
Contributor

@mtei mtei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a nice effect. I liked it.

The generated code size seems to be a bit larger than the other effects. I'd like to make it a little smaller, but it seems impossible.

I approve.

quantum/rgblight.c Show resolved Hide resolved
@mtei mtei requested a review from a team April 25, 2020 16:51
@spidey3
Copy link
Contributor Author

spidey3 commented Apr 25, 2020

The generated code size seems to be a bit larger than the other effects. I'd like to make it a little smaller, but it seems impossible.

Yes - I put some effort into reducing the code size, and found that this was about the best I could do. Interestingly, using lib8tion's random8() instead of rand() was actually worse, not better...

@spidey3
Copy link
Contributor Author

spidey3 commented May 7, 2020

gentle ping

@drashna
Copy link
Member

drashna commented May 9, 2020

Thanks!

@drashna drashna merged commit 2fe7e22 into qmk:master May 9, 2020
@spidey3 spidey3 deleted the rgblight_twinkle branch May 11, 2020 19:53
bitherder pushed a commit to bitherder/qmk_firmware that referenced this pull request May 15, 2020
* Add twinkle RGB Lighting effect

* 2nd twinkle algo - double-buffering

* Further refinement: Per-LED twinkle

* Add documentation for Twinkle RBG Lighting mode

* Bias twinkle saturation closer to the set value

* Fix whitespace
drashna pushed a commit to zsa/qmk_firmware that referenced this pull request May 24, 2020
* Add twinkle RGB Lighting effect

* 2nd twinkle algo - double-buffering

* Further refinement: Per-LED twinkle

* Add documentation for Twinkle RBG Lighting mode

* Bias twinkle saturation closer to the set value

* Fix whitespace
sowbug pushed a commit to sowbug/qmk_firmware that referenced this pull request May 24, 2020
* Add twinkle RGB Lighting effect

* 2nd twinkle algo - double-buffering

* Further refinement: Per-LED twinkle

* Add documentation for Twinkle RBG Lighting mode

* Bias twinkle saturation closer to the set value

* Fix whitespace
fdidron pushed a commit to zsa/qmk_firmware that referenced this pull request Jun 12, 2020
* Add twinkle RGB Lighting effect

* 2nd twinkle algo - double-buffering

* Further refinement: Per-LED twinkle

* Add documentation for Twinkle RBG Lighting mode

* Bias twinkle saturation closer to the set value

* Fix whitespace
turky pushed a commit to turky/qmk_firmware that referenced this pull request Jun 13, 2020
* Add twinkle RGB Lighting effect

* 2nd twinkle algo - double-buffering

* Further refinement: Per-LED twinkle

* Add documentation for Twinkle RBG Lighting mode

* Bias twinkle saturation closer to the set value

* Fix whitespace
jakobaa pushed a commit to jakobaa/qmk_firmware that referenced this pull request Jul 7, 2020
* Add twinkle RGB Lighting effect

* 2nd twinkle algo - double-buffering

* Further refinement: Per-LED twinkle

* Add documentation for Twinkle RBG Lighting mode

* Bias twinkle saturation closer to the set value

* Fix whitespace
sjmacneil pushed a commit to sjmacneil/qmk_firmware that referenced this pull request Feb 19, 2021
* Add twinkle RGB Lighting effect

* 2nd twinkle algo - double-buffering

* Further refinement: Per-LED twinkle

* Add documentation for Twinkle RBG Lighting mode

* Bias twinkle saturation closer to the set value

* Fix whitespace
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
* Add twinkle RGB Lighting effect

* 2nd twinkle algo - double-buffering

* Further refinement: Per-LED twinkle

* Add documentation for Twinkle RBG Lighting mode

* Bias twinkle saturation closer to the set value

* Fix whitespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants