Giter VIP home page Giter VIP logo

nodemcu-ws2812-toy's Introduction

nodemcu-ws2812-toy

A little toy script using Lua for the NodeMCU to play with a WS2812 LED Strip

WS2812 Toy
Author: Andre Alves Garzia
Date: 2017-05-11

This is just a demo of WS2812, shining some LEDs with Lua. It plays three animations and stop. The code is quite naive, focused on creating very explicit and readable code even though it is spaghetti-ish.

  • Animation Strip Runner * The first animation, fills the strip with blue LEDs which run accross the strip and fade.

  • Animation Police * Blinks half the LED in Red and half in Blue, alternating, like a police lights.

  • Animation Rainbow * Randomize the colors of all LEDs and then animating them moving circularly in the strip.

  • All animations run for a number of iterations and then switch.
  • The animation is controlled using the timer module.
  • There are two functions for each animation:
    • one that starts it and schedule the timer.
    • one that animates it and is called by the timer on each iteration.

REMEMBER TO READ THE MANUAL

URL: https://nodemcu.readthedocs.io/en/master/en/modules/ws2812/

THE WS2812 MODULE

Has the pin D4 (NodeMCU) / 2 (ESP8266) hardcoded as where the strip is attached to. Use it.

Be aware that even though WS2812 LEDs are called RGB LEDs, the order of the colors is not actually RGB, it usually is GRB, don't ask me why.

nodemcu-ws2812-toy's People

Contributors

soapdog avatar

Stargazers

Paul Russo avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.