All Projects → microsoft → pxt-neopixel

microsoft / pxt-neopixel

Licence: MIT license
A Neo-Pixel package for pxt-microbit

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to pxt-neopixel

Pxt
Microsoft MakeCode (PXT - Programming eXperience Toolkit)
Stars: ✭ 1,649 (+3408.51%)
Mutual labels:  microbit, pxt, makecode
pxt-calliope
A Microsoft MakeCode editor for the Calliope Mini board
Stars: ✭ 33 (-29.79%)
Mutual labels:  microbit, makecode
ArduLED
Control NeoPixels (ws2812b) easier than ever with an Arduino!
Stars: ✭ 25 (-46.81%)
Mutual labels:  neopixels, ws2812b
pxt-maker
MakeCode target for "Maker" boards (beta)
Stars: ✭ 107 (+127.66%)
Mutual labels:  pxt, makecode
WOWPixelDriver
A hardware based animation library,pixel driver & dynamic led mapping system for addressable LEDs
Stars: ✭ 39 (-17.02%)
Mutual labels:  neopixels, ws2812b
pxt-bluetooth-gamepad
BLE HID Gamepad module for micro:bit
Stars: ✭ 20 (-57.45%)
Mutual labels:  microbit, pxt
pxt-powerfunctions
MakeCode extension for controlling your LEGO Power Functions devices with an IR-emitting LED
Stars: ✭ 44 (-6.38%)
Mutual labels:  microbit, makecode
pxt-holidays
A Holiday Card sample target embedding PXT inside a React web app
Stars: ✭ 32 (-31.91%)
Mutual labels:  pxt, makecode
zig-bare-metal-microbit
Bare metal microbit program written in zig
Stars: ✭ 27 (-42.55%)
Mutual labels:  microbit
Python-For-Kids
A comprehensive and FREE Online Python Development tutorial FOR KIDS utilizing an official BBC micro:bit Development Board going step-by-step into the world of Python for microcontrollers.
Stars: ✭ 621 (+1221.28%)
Mutual labels:  microbit
tinyfont
Text library for TinyGo displays
Stars: ✭ 37 (-21.28%)
Mutual labels:  microbit
music led strip control
Audio visualization for LED strips in real-time with web interface on a raspberry pi.
Stars: ✭ 224 (+376.6%)
Mutual labels:  ws2812b
raspi ws2812
A kernel module able to run as many WS2812 strips as there are GPIO pins on Raspberry Pi Zero
Stars: ✭ 35 (-25.53%)
Mutual labels:  ws2812b
WS281x.swift
A Swift library for WS281x (WS2811,WS2812*,WS2813*) RGB led strips, rings, sticks, matrices and more.
Stars: ✭ 32 (-31.91%)
Mutual labels:  ws2812b
dirty-leds
Music reactive WS2812b LEDs with an ESP8266
Stars: ✭ 24 (-48.94%)
Mutual labels:  ws2812b
h3dmx512-zip
Images for Allwinner H2+/H3 DMX512 / RDM / Art-Net / sACN / USBPro / Pixel / WS28xx / TCNet / SMPTE
Stars: ✭ 57 (+21.28%)
Mutual labels:  neopixels
pxt-linebeacon
LINE Beacon for micro:bit
Stars: ✭ 28 (-40.43%)
Mutual labels:  microbit
HB-UNI-RGB-LED-CTRL
HomeMatic compatible RGB Controller for adressable RGB LEDs (WS28xx, Neopixel,...)
Stars: ✭ 19 (-59.57%)
Mutual labels:  ws2812b
pxt-minode
mi:node kit(micro:bit IoT Starter Kit by element14) driver package for PXT/microbit
Stars: ✭ 25 (-46.81%)
Mutual labels:  microbit
splendida
256 WS2812B LEDs arranged in Fermat's Spiral Shape
Stars: ✭ 28 (-40.43%)
Mutual labels:  ws2812b

NeoPixel driver

This library provides a driver for various Neo Pixel LED strips, see https://www.adafruit.com/category/168.

NeoPixels consist of programmable RGB LEDs (WS2812B), every one of them controlled separately.

~ hint

See Microsoft/pxt-ws2812b for basic WS2812B led support.

~

Basic usage

// Create a NeoPixel driver - specify the pin, number of LEDs, and the type of 
// the NeoPixel srip, either standard RGB (with GRB or RGB format) or RGB+White.
let strip = neopixel.create(DigitalPin.P0, 24, NeoPixelMode.RGB);

// set pixel colors
strip.setPixelColor(0, NeoPixelColors.White); // white
strip.setPixelColor(1, 0xff0000);     // red
strip.setPixelColor(2, 0x00ff00);     // green
strip.setPixelColor(3, NeoPixelColors.Blue);    // blue

// send the data to the strip
strip.show()

Use ||setBrightness|| to lower the brightness (it's maxed out by default).

Use ||shift|| or ||rotate|| to shift the lights around.

Use ||setPixelWhiteLED|| to set brightness of the white pixel for RGB+W strips.

HSL color format

Use neopixel.hslToRgb() to create colors using hue, saturation, and lightness.

Example: Using accelerometer to control colors

This little program will let the position of the microbit control the color of the first LED. This first LED will then get shifted further away every 100ms.

let strip = neopixel.create(DigitalPin.P0, 24, NeoPixelMode.RGB_RGB)
while (true) {
    let x = input.acceleration(Dimension.X) / 2;
    let y = input.acceleration(Dimension.Y) / 2;
    let z = input.acceleration(Dimension.Z) / 2;
    strip.shift(1);
    strip.setPixelColor(0, neopixel.rgb(x, y, -z));
    strip.show();
    basic.pause(100);
}

Supported targets

  • for PXT/microbit
  • for PXT/calliope

License

MIT

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 [email protected] with any additional questions or comments.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].