The tutorial is available on Tuts+.
The Tuts+ tutorial was written with v1 code, so some code snippets in the tutorial do not match in the latest code in this repo. See the changes below.
- Instead of sending each color value like
{color:red, brightness: 123}
, now all color values is sent as one object at a time, as{r: 123, g: 98, b: 0}
- Added
subscribe()
in the front-end code to reset the UI slider position every time other subscribers make changes - Added
history()
in the front-end code to initialize the UI slider's initial state by reading the very last values from history - Added
history()
in the node.js code to initialize the LED color state at the initial load