Code Monkey home page Code Monkey logo

jellyfish-rs's Introduction

oh look, a jellyfish

jellyfish.

ambient lighting on your desktop using neopixels!

Status GitHub commit activity GitHub Issues or Pull Requests


IMG_1036-ezgif com-speed

💫about this project💫

NeoPixels is a great way to implement lighting effects of your own. It is easily programmable and cheap to do. So using a strip and a Pi Pico W I had lying around, I made this project.

This project was just a experiment of mines to see if it is possible to add reactive lighting to my monitor and do so without the cost of performance. Feel free to look at the source code to see how I did it.

If you want, you can download it. I've made a lot of optimizations and features into Jellyfish. You can even tune the brightness, or saturation of the colors!

Ever wanted to add extra lighting to your setup? This project is a great way to do so. It uses serial communication to send lighting data from the PC to circuitpython, and rust to process it via the PC.

🧰made with🧰

  • Rust
  • Raspberry Pi
  • Python

crates used

🛠️building🛠️

Before building you must have git and rust installed on your system!

git clone https://github.com/porplax/jellyfish-rs
cd jellyfish-rs
cargo build

Building release profile will not work if /assets from the root directory is not in the same one as the executable.

PS: This was bulit on windows. I am unsure if other operating systems are supported.

🖋️getting started🖋️

Jellyfish is a DIY project. All you need is a circuitpython board, few wires, and a neopixel LED strip (i don't know if other LEDs can work, this is just from experience).

getting things right

If you really wanna get things right, it is essential to have the right size LED for your desk setup. Here was my setup.

You can use other boards, but they must be able to run on circuitpython. Any other firmware that has the NeoPixels library on it can be used, but Neobridge doesn't support that :(

prerequisites

Before you can run the jellyfish program, you'll need a circuitpython board to run Neobridge.

If you have a RPI Pico/RPI Pico W board, you can use the automated installer on windows.

If you have another board or want to do manual installation, here are the instructions:

  • Download a Circuitpython 8.x/9.x .UF2 file, the library bundle and code.py.
  • Flash the Circuitpython 8.x/9.x .UF2 file onto your board.
  • Move neopixel.mpy from the bundle to \lib.
  • Modify code.py by changing the pinout, number of pixels, and order.
  • Make sure it is running and will run each bootup.

installing the project

gui

  • Download jellyfish-v2.0.0.zip into a suitable location.
  • Extract
  • Simply run the .exe file, and you can start using Jellyfish!

Smartscreen will mistake it for malware. if it does, click run anyway.

Supported platforms

  • Windows 10 and up

📃to-do list📃

  • Automated installation script for circuitpython.
  • Contribution section.
  • Detailed step-by-step tutorial with pictures.
  • Switch to an event-loop driven UI library.
  • 'Run in background' option, I've tried multiple times but it is pretty hard to do atm.
  • Switch to async, instead of using threads

known issues and bugs

There are no known bugs or issues! If you find one, please make an issue.

those involved

  • @porplax, @Localis9 - Creator of the project. (@zaynes_starr on discord), (Localis is just my old acc)

See also the list of contributors who participated in this project.

jellyfish-rs's People

Contributors

localis9 avatar porplax avatar

Stargazers

Felix avatar

Watchers

 avatar

jellyfish-rs's Issues

Med: all LEDs will start flickering if GPU usage is unstable. (Minecraft Specific)

request stuff here!

Odd thing I realized when I tried to undervolt my GPU and benchmarked. This is similar to #6 but instead of being one LED on the strip, its the entire strip itself that started doing this.

It could be the result of throttling or Windows cutting resources to the program when usage becomes too high. But I am clueless on what it could actually be.

It may be an issue coming from screenshots library which in fairness, is no longer being worked on and preferred that xcap is used but I use the library for performance gains. I'll look into the issue more in a later release.

Implement winapi-rs into CLI for lower thread priority.

request stuff here!

Heads up, this has already been tested. This probably won't be implemented which is why I only put it as a suggestion. This forces windows to give less resources to the process.

unsafe {
    SetThreadPriority(GetCurrentThread(), -2); // -2 is THREAD_PRIORITY_LOWEST
}

The issues with this is that winapi is only for windows. So this would have to be an option for CLI. Not sure about adding this so I am open to comments.

Flickering LED when pixel is too dark.

request stuff here!

Saturation calculation is a bit janky atm. Saturation takes a RGB value and if saturation is 0 or the brightest RGB value is 0, then it returns the pixel as pitch black. This is probably what's causing it.

// ...
if max != 0.0 {
    saturation = delta / max;
} else {
    return RGB(0, 0, 0)
}
// ...
if saturation == 0.0 {
    return RGB(0, 0, 0)
}

Remove `--width, --height` and replace with `--monitor` argument.

request stuff here!

--width, --height is useless and can instead be replaced with --monitor.

Get width and height dimensions from Monitor::all().unwrap();. This also lets the user select which monitor to screen record from instead of just forcing primary monitor.

--monitor [index] - index being which monitor to capture from (0 is primary)
Screenshot 2024-06-11 224009

Replace nested iterators with higher order functions.

request stuff here!

Ever since the restructure (see fc0e04c), I think the project should work on improving the iterators in render::JellyRender::grab().

I've looked at the image crate and I think most of this code can literally be broken down into simple map functions or the method of screen recording can be different.
code

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.