Git Product home page Git Product logo

easyopc-rust's Introduction

easyopc - Open Pixel Control in Rust

An ergonomics-first Open Pixel Control client for devices like Fadecandy and Total Control Lighting.

Usage

extern crate easyopc;

use easyopc::*;

fn main() {
    let mut opc = PixelControl::default();
    let mut pixels = vec![Pixel{r:0,g:0,b:0}; 512];
    draw_with_interval_ms(1000, ||{
        for i in 0..512 {
            pixels[i] = opc.random_color();
        }
        opc.emit(&pixels).unwrap();
    });
}

Stability

This library is currently pre-1.0, which means breaking changes will happen. Consider pinning to a specific version to not have your build break.

My intention for this library is to create a small set of examples and simplify the api as needed to make the examples easier, more succinctly expressive, and simpler. Once I have a diverse set of examples at a satisfactory local minimum of complexity, I'll stabilize the library. Please open an issue if you have an example that's overly difficult to implement.

Configuration

Configuration is drawn from environment variables with sensible defaults.

Examples

Random Pixels

Sets ever pixel in the canvas to a random RGB value every second.

cargo run --example random_pixels

RGB Rotate

Rotates through red, green, and blue every 10 seconds. This demonstrates crossfading well.

cargo run --example rgb_rotate

easyopc-rust's People

Contributors

nicodemus26 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.