Download the PHP package phpdafruit/neopixel-php without Composer

On this page you can find all versions of the php package phpdafruit/neopixel-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package neopixel-php

neopixel-php

A modern PHP 8.3+ library for controlling WS281x/NeoPixel LED strips, fans, and devices using the phpixel extension. This package provides an elegant, object-oriented API with shape-specific abstractions for common LED configurations.

Features

Requirements

Installation

Install via Composer

Install phpixel Extension

Before using this library, you must install the phpixel extension on your embedded Linux device. See the phpixel extension installation guide for complete instructions.

Core Concepts

PixelChannel

A PixelChannel is an object-oriented wrapper around the phpixel extension's NeoPixel class. It represents a single controllable LED device (strip, fan, or individual LED) connected to a specific SPI device.

Basic Usage

Available Methods

Core Operations:

Brightness & Configuration:

Information:

Effects & Animations:

All methods that modify state return $this for method chaining.

PixelBus

A PixelBus manages multiple PixelChannel instances, allowing you to control multiple LED devices as a coordinated system. Each channel is identified by a unique name.

Basic Usage

Available Methods

Channel Management:

Operations:

Device Shapes

Device shapes are specialized classes that extend PixelChannel with methods tailored to specific LED configurations. They provide semantic, shape-aware APIs for common use cases.

SingleDiode

Represents a single LED, perfect for status indicators, notifications, and simple alerts.

DoubleDots

Represents two LEDs, ideal for PC fans, dual indicators, or side-by-side effects.

RGBStrip

Represents a linear LED strip, perfect for underglow, room lighting, and complex animations.

Creating Custom Shapes

You can extend PixelChannel to create custom device shapes for your specific LED configurations:

Potential custom shapes include:

Animations

The library includes 35 built-in animations that can be played on any PixelChannel or device shape using the animate() method.

Quick Start

Available Animations

The library includes animations in these categories:

For complete documentation of all 35 animations with usage examples and customization options, see ANIMATIONS.md.

Animation Architecture

The animation system consists of:

Custom Animations

Create custom animations by implementing AnimationVisualization:

Register your custom animation:

Enums

The library provides type-safe enums for improved code clarity and IDE support.

NeoPixelType

Defines the color channel order for your LED devices. Different LED models use different orders.

Usage:

SPIDevice

Provides convenient access to common SPI device paths.

Benefits:

Usage:

Testing

The library includes a comprehensive Pest v4 test suite covering unit tests, integration tests, and hardware scenarios.

Running Tests

Test Structure

Notes on Testing

Examples

The package includes five comprehensive examples demonstrating various features and use cases.

Running Examples

All examples are located in the examples/ directory and can be run directly via PHP CLI on your embedded device:

Example Overview

01_single_channel_basic.php

02_pixel_bus_multi_channel.php

03_advanced_animations.php

04_new_convenience_methods.php

05_device_shapes_demo.php

Hardware Requirements for Examples

Most examples expect at least one LED device connected to an available SPI port. Adjust the device paths and pixel counts in the examples to match your hardware configuration.

Troubleshooting

Extension Not Found

Solution: Install the phpixel extension first.

SPI Device Not Found

Solution:

Wrong Colors

If colors appear incorrect (e.g., red shows as green), you're using the wrong color order.

Solution: Try different NeoPixelType values:

License

MIT License. See LICENSE file for details.

Credits

This library wraps the phpixel extension, which provides the low-level SPI interface for WS281x LED control.

Contributing

Contributions are welcome. When contributing:

Support

For issues related to:


Changelog

v2.0.0 - Animation System Release (Current)

Major Features:

New Animations:

API Additions:

Documentation:

Breaking Changes:


v1.0.0 - Initial Release

Core Features:

Supported Hardware:

Requirements:

For a complete feature list and usage examples from v1.0.0, see the Device Shapes and Examples sections above.


All versions of neopixel-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-phpixel Version *
ext-sockets Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phpdafruit/neopixel-php contains the following files

Loading the files please wait ...