led-matrix-controllers 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# LED Matrix Controllers
|
|
2
2
|
|
|
3
|
-
Cross-firmware controllers
|
|
3
|
+
Cross-firmware controllers for the [Framework Laptop 16 LED matrix module](https://frame.work/products/16-led-matrix) using WebHID and Web Serial APIs
|
|
4
4
|
|
|
5
5
|
## Supported Firmwares
|
|
6
6
|
|
|
@@ -14,11 +14,51 @@ If you maintain another firmware or a fork, please open an issue or submit a PR!
|
|
|
14
14
|
|
|
15
15
|
### Installation
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
#### Browser
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<script type="module">
|
|
21
|
+
import { DefaultController } from 'https://esm.sh/led-matrix-controllers@latest';
|
|
22
|
+
const controller = new DefaultController();
|
|
23
|
+
await controller.connect();
|
|
24
|
+
// ...
|
|
25
|
+
</script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
#### Node.js
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install led-matrix-controllers
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Also see [examples/webpack/](examples/webpack/)
|
|
18
35
|
|
|
19
36
|
### Usage
|
|
20
37
|
|
|
21
|
-
|
|
38
|
+
#### For specific firmware
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
// Controllers for specific firmware
|
|
42
|
+
import { DefaultController, SigrootController, SparkleController } from 'led-matrix-controllers';
|
|
43
|
+
|
|
44
|
+
const controller = new DefaultController();
|
|
45
|
+
await controller.connect();
|
|
46
|
+
await controller.draw( /* 34x9 matrix array */ );
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Also see [examples/sparkle.html](examples/sparkle.html)
|
|
50
|
+
|
|
51
|
+
#### For specific interface
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
import { HardwareControllerFactory } from 'led-matrix-controllers';
|
|
55
|
+
|
|
56
|
+
// connect to device
|
|
57
|
+
const foo = HardwareControllerFactory.detectSerial();
|
|
58
|
+
const bar = HardwareControllerFactory.detectHID();
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Also see [examples/detect-firmware.html](examples/detect-firmware.html)
|
|
22
62
|
|
|
23
63
|
## Development
|
|
24
64
|
|