All Projects → zeroping → sysfsled

zeroping / sysfsled

Licence: Apache-2.0 License
C++ library for the linux kernel's LED device class

Programming Languages

CMake
9771 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to sysfsled

pi pico neopixel
Pi Pico library for NeoPixel led-strip written in MicroPython. Works with ws2812b (RGB) and sk6812 (RGBW).
Stars: ✭ 70 (+366.67%)
Mutual labels:  leds
sparklemotion
Sparkle Motion
Stars: ✭ 24 (+60%)
Mutual labels:  leds
rpi-ws2812-server
Raspberry Pi WS2812 (web) server tool
Stars: ✭ 143 (+853.33%)
Mutual labels:  leds
TinyPixelMapper
a Pixelmapping software for the ESP32 and ESP8266 for addressible LED Strips, with a OSC controll interface and FFT
Stars: ✭ 22 (+46.67%)
Mutual labels:  leds
SuperGreenOS
🧠 SuperGreenOS home farming automation software for esp32, all in one package, and controllable from your smartphone, pc, mac, linux, toaster, plumbus, whatnot...
Stars: ✭ 83 (+453.33%)
Mutual labels:  leds
led-speech-edison
Speech-activated LEDs using Intel Edison, SparkFun blocks, Python, and CMU Sphinx
Stars: ✭ 25 (+66.67%)
Mutual labels:  leds
OctoWifi-LEDs-Controller
LEDs driver for ESP32 ( support ART-NET, RGB888, RGB565, Z888 )
Stars: ✭ 16 (+6.67%)
Mutual labels:  leds
Stranger Things Wall
A wall of addressable LEDs inspired by the Netflix series Stranger Things that displays messages from Twitter.
Stars: ✭ 22 (+46.67%)
Mutual labels:  leds
Wordclock
Diy Wordclock with an esp32 and ws2812b Leds
Stars: ✭ 19 (+26.67%)
Mutual labels:  leds
ArduLED
Control NeoPixels (ws2812b) easier than ever with an Arduino!
Stars: ✭ 25 (+66.67%)
Mutual labels:  leds
Lightwork
Computer vision based LED mapping framework
Stars: ✭ 124 (+726.67%)
Mutual labels:  leds
Uno vu line
Arduino code for a stereo VU meter with lots of patterns
Stars: ✭ 62 (+313.33%)
Mutual labels:  leds
HomeStatusDisplay
Show smart home status information sent via MQTT using RGB LEDs.
Stars: ✭ 21 (+40%)
Mutual labels:  leds
PixelMaestro
Library for creating and rendering 2D animations and patterns.
Stars: ✭ 20 (+33.33%)
Mutual labels:  leds

Sysfsled Library

A C++ library for the Linux kernel's LED device class.

What It's For

You might have used the LEDs on a single-board computer running Linux, such as a Raspberry Pi or other embedded system. If you did, you probably used either direct GPIO, or the kernel's built-in Linux subsystem for LEDs, with something like:

echo 0 > /sys/class/leds/tpacpi\:\:power/brightness

This is a quick little C++ library for that built-in kernel interface, so you don't have to mess with writing strings to magical files. Instead, you can do things like:

vector<LED> led_list = LED::getSystemLEDs();

or

myled.set_state(true);
myled.set_brightness(0.5);

How it works

Under the hood, this is using libudevpp, a C++ wrapper for libudev, which is itself a C library for manipulating entires in /sys.

This uses CMake as the build system, so you'll need it installed, as well as libudev. libudevpp will get downloaded automatically. These dependancies might require you to do something like:

sudo apt install libudev-dev cmake build-essential

You can try this out by cloning, building, and running the example program:

git clone https://github.com/zeroping/sysfsled.git
cd sysfsled
mkdir build
cd build
cmake ../
make

Then, to list available LEDs:

./example/led_flash

And to flash an LED on my laptop:

sudo ./example/led_flash /sys/devices/platform/thinkpad_acpi/leds/tpacpi::power

Work From Here

This library still needs all sorts of things to fully support what the kernel subsystem can do. The glaring omission is that this library can't set up triggers.

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].