项目作者: hussainb

项目描述 :
Micropython classes to animate neopixels
高级语言: Python
项目地址: git://github.com/hussainb/micropython-pixels.git
创建时间: 2019-01-01T14:15:55Z
项目社区:https://github.com/hussainb/micropython-pixels

开源协议:MIT License

下载


Micropython-pixels

Micropython classes to animate neopixels

Getting Started

Upload the pixel.py to your device using uPyCraft IDE
Import pixel in your main.py
Follow examples in main.py from the repository

Prerequisites

  • Neopixels/ws2812b strip
  • NodeMCU or ESP32
  • Basic knowledge of electronics

Guide to get started with micropython on ESP8266

Docs

Import the pixel module in your main.py

  1. import pixel

The module exposes the below two classes

  • PixelBlink

Initialize an Object as shown below

  1. p1 = PixelBlink(0, 255, 165, 0, 700)
  2. """
  3. @param id: number/location of neopixel LED
  4. @param R: Red color value
  5. @param G: Green color value
  6. @param B: Blue color value
  7. @param interval: LED On/Off interval
  8. """

The Object p1 now has a method next() which when called updates the neopixel LED with its next state

  • PixelFadeInOut

Initialize an Object as shown below

  1. p2 = PixelFadeInOut(1, 0, 0, 255, 255, 192, 203, 200, 30)
  2. """
  3. @param id: number/location of neopixel LED
  4. @param R1: Red color value to begin from
  5. @param G1: Green color value to begin from
  6. @param B1: Blue color value to begin from
  7. @param R2: Red color value to end to
  8. @param G2: Green color value to end to
  9. @param B2: Blue color value to end to
  10. @param steps: No of times updates to be performed on LED in given interval
  11. @param interval: transition to complete in given interval
  12. """

The Object p2 now has a method next() which when called updates the neopixel LED with its next state

  • Refer main.py from the repository for implementation and examples.

Authors

  • Hussain Bharmal - Initial work - hussainb

License

This project is licensed under the MIT License - see the LICENSE file for details