LED Strip - Pi4J Home About Previous versions (V.1) What's New (V.2) Release Notes License (Open Source) The Team Getting started with Pi4J Set up a new Raspberry Pi Understanding the GPIO pins Electrical Engineering Java development with VSC Developing on a remote PC Minimal example application Minimal example as FAT JAR Electronics with CrowPi CrowPi OS Develop with Intellij IDEA User interface with JavaFX Game development with FXGL FXGl to Picade JavaFX kiosk mode JavaFX GUI and MVC template Learn more... Documentation Pin numbering Java for ARMv6/7/8 Logging with SLF4J Creating a Pi4J Context Choosing a Platform Raspberry Pi Choosing an I/O Provider LinuxFS PiGpio Building an I/O Instance I/O Examples Digital Output (GPIO) Digital Input (GPIO) Pulse Width Modulation (PWM) Inter-Integrated Circuit (I²C) I²C Clock Stretching Serial Peripheral Interface (SPI) Serial (UART/RS232) I/O Registry Shutting down the Pi4J Context Building and running Building with javac Build as a FAT JAR with Maven Build Java modules with Maven Build Java modules with Gradle Running Pi4J with JBang Example implementations Component examples Simple Button Simple LED AD Converter ADS1115 Buzzer Camera Joystick Joystick Analog LCD Display LED Button LED Matrix LED Strip Potentiometer ServoMotor Community Implementations Architecture/Design Project source structure Download/Install Direct Download Installation Build Instructions Maven settings Code styling Hardware testing Advanced Annotated provisioning Dependency injection Native Library Path Plug-ins Remote support Third-Party Integration The Pi4J Logo Pi4J Kotlin DSL Minimal Kotlin Pi4J example Kotlin API & DSL Documentation Featured Projects Soft real time PLC PiJukeBox Cocktail Maker Didier the street artist robot JMonkeyEngine with Joystick Sensor drivers More Tags GitHub project Twitter @pi4j Pi4J Forum Built with from Grav and Hugo Edit this page Welcome to Pi4J > Example implementations > Component examples > LED Strip Description Layout Code Further application Further project ideas LEDStrip LED Strip Description The LEDStrip is a template class, that you can use in your own Java-project. You can take a LED Strip with the WS28xx-chip set. The Template Class gives you the option to set the LED’s of the strip to a desired RGB-Color. If you have many strips, you can use the LEDMatrix Make sure to check if SPI is enabled in your RaspberryPI. Check the SPI Address. Default is “SPI0 MOSI” Pin (#19). Layout LED Strip 4 LED Breadboard LED Strip 4 LED Code A simple example on how to use the LEDStrip-Class from the Hardware-Catalog: // Initialize the RGB int pixels = 4; final var ledstrip = new LEDStrip(pi4j, pixels, 0.5);