Git Product home page Git Product logo

ws2812-flexio's Introduction

ws2812-flexio

Crates.io Crates.io License Build Status docs.rs

A neopixel driver based on NXP i.MX RT's FlexIO bus.

Pixel Type

The default color space of NeoPixel LED strips is 8-bit linear sRGB, therefore the recommended pixel type is LinSrgb<u8>.

Be aware that this differs from normal, gamma corrected sRGB; a conversion has to take place. More info can be found in the documentation of the palette crate.

Operating Modes

This crate can operate either in blocking mode or in DMA driven asynchronous mode.

Specs

Parallel strips

The library can drive multiple strips in parallel. To be more specific, driving multiple strips from the same FlexIO instance requires 2 + 2 * strips FlexIO timers, so a for example a FlexIO instance with 8 timers can drive 3 strips in parallel.

Framerate

The library drives the LED strips at 800kHz with a latch time of 300us. This gives us the following formula:

fps = 100,000 / ((num_pixels + 1) x bytes_per_pixel + 30)

Example: For a strip with 332 SK6805 pixels, we can achieve 100,000 / ((332 + 1) * 3 + 30) = 97.18 fps.

Be aware that this framerate is only realistic for DMA based writes; with blocking writes, additional time gets lost while the next frame gets computed.

Examples

- examples are intended for the Teensy 4.0 board -

Prerequisites

The following hardware is required for the examples:

  • A Teensy 4.0 development board
  • A way to read the Teensy's UART, like a USB-UART-converter

The following software tools have to be installed:

  • Python3 (as python3, or modify run.py to use the python binary)
  • llvm-objcopy
    • Install LLVM tool suite
  • teensy-loader-cli

Run

  • Connect the Teensy to PC via USB cable.
  • Run cargo run --release --example triple_332.
  • Read the output of the examples on the Teensy's UART.
  • Pin 6, 7 and 8 output data for NeoPixel RGB strips of length 332 each (for example P/N: S010332ZA3SA8). Note that those pins output 3.3V, and most NeoPixel LED strips require a 5V data signal, which means an external level shifter is required.

ws2812-flexio's People

Contributors

finomnis avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

psentee

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.