hansjny / Natural-Nerd

587 stars 445 forks source link

Update booknook.ino #32

Closed AdamMcArdle closed 4 years ago

AdamMcArdle commented 4 years ago

Added some new features:

  1. Dynamic lights now fade on and off, rather than just turning straight on, You can change the duration of the fade
  2. Dynamic lights now stay on/off for between 5 and 8 seconds (randomly chosen). During that time, any toggle() events are ignored.
  3. Set a load of macros at the top to allow easy configuration changes
  4. Made a slight tweak to how the random chances are calculated, so that if you set the random chance to "1", it will now fire every time.

To achieve number 1, I had to change things to use HSV rather than RGB to define the colors. By eye, the new HSV color seems pretty close to Hansi's original RGB value.