Skip to content

jpadgett314/led-matrix-controllers

Repository files navigation

LED Matrix Controllers

Cross-firmware controllers for the Framework Laptop 16 LED matrix module using WebHID and Web Serial APIs

Supported Firmwares

If you maintain another firmware or a fork, please open an issue or submit a PR!

Quick Start

Installation

Node.js

npm install led-matrix-controllers

CDN

<script type="importmap">
    {
        "imports": {
            "led-matrix-controllers": "https://esm.sh/led-matrix-controllers@latest"
        }
    }
</script>

Usage

For specific firmware

// Controllers for specific firmware
import { DefaultController, SigrootController, SparkleController } from 'led-matrix-controllers';

const controller = new DefaultController();
await controller.connect();
await controller.draw( /* 34x9 array of arrays of 0 to 1.0 */ );

For specific interface

import { HardwareControllerFactory } from 'led-matrix-controllers';

// connect to device
const serialController = await HardwareControllerFactory.detectSerial();
const hidController = await HardwareControllerFactory.detectHID();

Development

Prerequisites

  • Node.js (v18 or later)

Installation

Setup development environment

npm install

Bundle (for locally testing minified/non-ESM builds)

npm run build

Lint

npm run lint

Lint & Fix

npm run lint:fix

About

Cross-firmware controllers for the Framework Laptop 16 LED matrix module

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published