GithubHelp home page GithubHelp logo

jezorko / rpi5-ws2812x-fu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from praktronics/rpi5-rp1-spi

1.0 0.0 0.0 207 KB

Using the SPI on the Raspberry Pi 5 through direct register control on the RP1 to drive a WS2812x LED strip

License: GNU General Public License v3.0

C 99.53% CMake 0.47%

rpi5-ws2812x-fu's Introduction

rpi5-ws2812x-fu

Fork of https://github.com/praktronics/rpi5-rp1-spi

Using the SPI on the Raspberry Pi 5 through direct register control on the RP1 to drive a WS2812x LED strip.

To build and run:

    /rpi5-ws2812x-fu $ mkdir build
    /rpi5-ws2812x-fu $ cd build
    /rpi5-ws2812x-fu/build $ cmake ..
    /rpi5-ws2812x-fu/build $ cmake --build .

run with sudo or as root

    /rpi5-ws2812x-fu/build/bin $ sudo ./rpi5-rp1-spi

To compile a JNI .so library:

g++ -c -fPIC -I/usr/lib/jvm/default-java/include -I/usr/lib/jvm/default-java/include/linux rpi5-ws2812x-fu-jni.c -o jezor_jni_RPi5RP1SPI.o
g++ -shared -fPIC -o librpi5ws2812xfu.so jezor_jni_RPi5RP1SPI.o -lc

This will match the following Java class:

package jezor.jni;

public class RPi5RP1SPI {

    public native void initializeStrip(int ledsCount);
    public native int getLedsCount();
    public native int getGreenComponent(int ledIndex);
    public native int getRedComponent(int ledIndex);
    public native int getBlueComponent(int ledIndex);
    public native void setLed(int ledIndex, int red, int green, int blue);
    public native void renderStrip();
    public native void closeStrip();

}

rpi5-ws2812x-fu's People

Contributors

jezorko avatar praktronics avatar

Stargazers

 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.