A driver for WS2812B LEDs in MakeCode
Перейти к файлу
microsoft-github-policy-service[bot] 2e452298bf
Microsoft mandatory file (#4)
Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com>
2022-09-01 13:21:22 -07:00
.github/workflows use makecode name 2022-04-27 16:18:05 +00:00
.vscode initial push 2018-02-27 16:51:35 -08:00
.gitignore initial push 2018-02-27 16:51:35 -08:00
LICENSE Initial commit 2018-02-27 16:46:07 -08:00
Makefile initial push 2018-02-27 16:51:35 -08:00
README.md setmode (#2) 2020-05-21 11:28:33 -07:00
SECURITY.md Microsoft mandatory file (#4) 2022-09-01 13:21:22 -07:00
icon.png adding icon 2018-05-23 08:43:12 -07:00
main.ts add constants 2022-04-27 09:14:45 -07:00
pxt.json 0.1.2 2022-04-27 16:18:19 +00:00
sendBuffer.asm initial push 2018-02-27 16:51:35 -08:00
setBufferMode.asm Add missing return in setBufferMode 2020-05-22 09:22:45 -07:00
test.ts setmode (#2) 2020-05-21 11:28:33 -07:00
tsconfig.json initial push 2018-02-27 16:51:35 -08:00

README.md

ws2812

A driver for WS2812B programmable LEDs in MakeCode.

Usage

sendBuffer

The package exposes ws2812b.sendBuffer that bit-bangs a color buffer for WS2812B LEDs over a pin.

See https://github.com/microsoft/pxt-neopixel for an example of usage.

setBufferMode

This function allows to specify the color layout in the buffer.

#define LIGHTMODE_RGB 1
#define LIGHTMODE_RGBW 2
#define LIGHTMODE_RGB_RGB 3

~ hint

Bluetooth disabled: This package disables BLE as the real time requirements of the WS2812 conflict with the BLE stack.

~

Simulator support

The sendBuffer function is supported by the micro:bit simulator!

License

MIT

Supported targets

  • for PXT/microbit
  • for PXT/calliope

(The metadata above is needed for package search.)

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.