Skip to content

Wipy driver for WS2812 RGB LEDs (WS2812B, AdaFruit NeoPixels, ...).

License

Notifications You must be signed in to change notification settings

Oliv4945/wipy-WS2812

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Wipy-LoPy-MicroPython WS2812 driver

Wipy-LoPy-MicroPython driver for WS2812, WS2812B, and compatible RGB LEDs. These are popular RGB LEDs used for example in AdaFruit NeoPixels rings, strips, boards, etc.

Driver has been tested with up to 16 LEDs (for now) but it should work with much more LEDs.

Installation

Copy ws2812.py file to your pyboard.

Usage

from ws2812 import WS2812
chain = WS2812( ledNumber=4, dataPin='P22' )
data = [
    (255, 0, 0),    # red
    (0, 255, 0),    # green
    (0, 0, 255),    # blue
    (85, 85, 85),   # white
]
chain.show(data)

Wiring

WS2812 driver is using SPI bus. Connect your LED's input wire to the SPI bus 0, MOSI is

  • WiPy: pin GP16
  • LoPy: pin P22 by default (G9 on extension board)

Connect LED's power and ground wires to VIN and GND. The same applies for LED rings, stripes, etc. (they have always one input wire).

USB may be insufficient for powering lots of RGB LEDs. You may need to use additional power source.

More info & Help

You can check more about the MicroPython project here: http://micropython.org

Discussion about this driver: http://forum.micropython.org/viewtopic.php?f=5&t=394

Changelog

  • 1.1 - Add support for LoPy
  • 1.0 - First release.

Credit

Based on : https://github.com/JanBednarik/micropython-ws2812

About

Wipy driver for WS2812 RGB LEDs (WS2812B, AdaFruit NeoPixels, ...).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages