node-red-contrib-periph-led 1.5.1 → 1.5.3

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 CHANGED
@@ -1,6 +1,10 @@
1
1
  # node-red-contrib-periph-led
2
2
 
3
- Node-RED nodes for LED driver chips — part of the [Periph](https://github.com/tuhde/Periph) library.
3
+ Node-RED nodes for LED driver chips: APA102, HT16K33, IS31FL3731, PCA9685, SK6812RGBW, WS2812B, WS2814 — part of the [Periph](https://github.com/tuhde/Periph) library.
4
+
5
+ **Supported chips (7):** APA102, HT16K33, IS31FL3731, PCA9685, SK6812RGBW, WS2812B, WS2814.
6
+
7
+ Each chip has a sensor/actuator node plus a shared `-device` config node that holds the bus settings. Importable example flows are in [`examples/`](https://github.com/tuhde/Periph/tree/main/nodejs/packages/node-red-contrib-periph-led/examples).
4
8
 
5
9
  ## Install
6
10
 
@@ -17,19 +21,19 @@ npm install node-red-contrib-periph-led
17
21
  | Node | Kind | Description |
18
22
  |------|------|-------------|
19
23
  | `apa102-device` | config | SPI bus and device index for an APA102 |
20
- | `periph-apa102` | output | Controls an APA102 addressable RGB LED strip over SPI (synchronous two-wire protocol). |
24
+ | `apa102` | output | Controls an APA102 addressable RGB LED strip over SPI (synchronous two-wire protocol). |
21
25
  | `ht16k33-device` | config | I²C bus and address for a HT16K33 |
22
- | `periph-ht16k33` | input | Controls a HT16K33 16 × 8 LED matrix driver over I²C: set pixels, write the display RAM, change brightness and blink rate, and read the 13 × 3 key matrix. |
26
+ | `ht16k33` | input | Controls a HT16K33 16 × 8 LED matrix driver over I²C: set pixels, write the display RAM, change brightness and blink rate, and read the 13 × 3 key matrix. |
23
27
  | `is31fl3731-device` | config | I²C bus and address for an IS31FL3731 |
24
- | `periph-is31fl3731` | input | Controls an IS31FL3731 144-LED matrix driver (9 × 16, 8-bit PWM per LED) over I²C. The node draws into frame 1 in Picture mode. |
28
+ | `is31fl3731` | input | Controls an IS31FL3731 144-LED matrix driver (9 × 16, 8-bit PWM per LED) over I²C. The node draws into frame 1 in Picture mode. |
25
29
  | `pca9685-device` | config | I²C bus and address for a PCA9685 |
26
- | `periph-pca9685` | input | Controls the 16 PWM channels of a PCA9685 (12-bit, 24–1526 Hz) over I²C. |
30
+ | `pca9685` | input | Controls the 16 PWM channels of a PCA9685 (12-bit, 24–1526 Hz) over I²C. |
27
31
  | `sk6812rgbw-device` | config | SPI bus and device index for a SK6812RGBW |
28
- | `periph-sk6812rgbw` | output | Controls an SK6812RGBW addressable RGBW LED strip over SPI (NeoPixel protocol). |
32
+ | `sk6812rgbw` | output | Controls an SK6812RGBW addressable RGBW LED strip over SPI (NeoPixel protocol). |
29
33
  | `ws2812b-device` | config | SPI bus and device index for a WS2812B |
30
- | `periph-ws2812b` | output | Controls a WS2812B addressable RGB LED strip over SPI (NeoPixel protocol). |
34
+ | `ws2812b` | output | Controls a WS2812B addressable RGB LED strip over SPI (NeoPixel protocol). |
31
35
  | `ws2814-device` | config | SPI bus and device index for a WS2814 |
32
- | `periph-ws2814` | output | Controls a WS2814 addressable RGBW LED strip over SPI (NeoPixel protocol). |
36
+ | `ws2814` | output | Controls a WS2814 addressable RGBW LED strip over SPI (NeoPixel protocol). |
33
37
 
34
38
  ## Links
35
39
 
@@ -115,7 +115,7 @@
115
115
  },
116
116
  {
117
117
  "id": "apa102-node",
118
- "type": "periph-apa102",
118
+ "type": "apa102",
119
119
  "z": "apa102-demo-tab",
120
120
  "name": "APA102",
121
121
  "device": "apa102-device-1",
@@ -4,7 +4,7 @@
4
4
  "type": "tab",
5
5
  "label": "HT16K33 Scrolling Pixel",
6
6
  "disabled": false,
7
- "info": "Moves a single lit pixel across all 16 x 8 positions of an LED matrix driven by an HT16K33 over I2C. An inject node fires every 100 ms, a function node advances the pixel position (COM 0-7, ROW 0-15) and the periph-ht16k33 node clears the previous pixel and writes the new one. A second inject node sweeps the brightness from 0 to 15."
7
+ "info": "Moves a single lit pixel across all 16 x 8 positions of an LED matrix driven by an HT16K33 over I2C. An inject node fires every 100 ms, a function node advances the pixel position (COM 0-7, ROW 0-15) and the ht16k33 node clears the previous pixel and writes the new one. A second inject node sweeps the brightness from 0 to 15."
8
8
  },
9
9
  {
10
10
  "id": "cfg-ht16k33",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  {
57
57
  "id": "write-lcd",
58
- "type": "periph-ht16k33",
58
+ "type": "ht16k33",
59
59
  "name": "Display",
60
60
  "device": "cfg-ht16k33",
61
61
  "z": "tab-ht16k33-demo",
@@ -4,7 +4,7 @@
4
4
  "type": "tab",
5
5
  "label": "IS31FL3731 Moving Dot",
6
6
  "disabled": false,
7
- "info": "Moves a single dot across the 9 x 16 LED matrix of an IS31FL3731 over I2C. An inject node fires every 100 ms, a function node advances the dot position (row 0-8, column 0-15) and the periph-is31fl3731 node switches the previous LED off and the new one on at full PWM brightness."
7
+ "info": "Moves a single dot across the 9 x 16 LED matrix of an IS31FL3731 over I2C. An inject node fires every 100 ms, a function node advances the dot position (row 0-8, column 0-15) and the is31fl3731 node switches the previous LED off and the new one on at full PWM brightness."
8
8
  },
9
9
  {
10
10
  "id": "cfg-is31fl3731",
@@ -55,7 +55,7 @@
55
55
  },
56
56
  {
57
57
  "id": "write-lcd",
58
- "type": "periph-is31fl3731",
58
+ "type": "is31fl3731",
59
59
  "name": "Display",
60
60
  "device": "cfg-is31fl3731",
61
61
  "z": "tab-is31fl3731-demo",
@@ -4,7 +4,7 @@
4
4
  "type": "tab",
5
5
  "label": "PCA9685 LED Fader and Servo",
6
6
  "disabled": false,
7
- "info": "Fades an LED on channel 0 of a PCA9685 with a sine-shaped duty cycle (inject every 100 ms, function node computes the duty) and sweeps a hobby servo on channel 1 with a pulse width between 1 ms and 2 ms. The device runs at 50 Hz so the servo works; the LED fade is therefore at 50 Hz as well. Both feed one periph-pca9685 node; debug nodes show the applied values."
7
+ "info": "Fades an LED on channel 0 of a PCA9685 with a sine-shaped duty cycle (inject every 100 ms, function node computes the duty) and sweeps a hobby servo on channel 1 with a pulse width between 1 ms and 2 ms. The device runs at 50 Hz so the servo works; the LED fade is therefore at 50 Hz as well. Both feed one pca9685 node; debug nodes show the applied values."
8
8
  },
9
9
  {
10
10
  "id": "cfg-pca9685",
@@ -96,7 +96,7 @@
96
96
  },
97
97
  {
98
98
  "id": "pwm-out",
99
- "type": "periph-pca9685",
99
+ "type": "pca9685",
100
100
  "name": "PCA9685",
101
101
  "device": "cfg-pca9685",
102
102
  "z": "tab-pca9685-demo",
@@ -81,7 +81,7 @@
81
81
  },
82
82
  {
83
83
  "id": "sk6812rgbw-node",
84
- "type": "periph-sk6812rgbw",
84
+ "type": "sk6812rgbw",
85
85
  "z": "sk6812rgbw-demo-tab",
86
86
  "name": "SK6812RGBW",
87
87
  "device": "sk6812rgbw-device-1",
@@ -92,7 +92,7 @@
92
92
  },
93
93
  {
94
94
  "id": "ws2812b-node",
95
- "type": "periph-ws2812b",
95
+ "type": "ws2812b",
96
96
  "z": "ws2812b-demo-tab",
97
97
  "name": "WS2812B",
98
98
  "device": "ws2812b-device-1",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  {
62
62
  "id": "ws2814-node",
63
- "type": "periph-ws2814",
63
+ "type": "ws2814",
64
64
  "z": "ws2814-demo-tab",
65
65
  "name": "WS2814",
66
66
  "device": "ws2814-device-1",
@@ -39,7 +39,7 @@
39
39
  </script>
40
40
 
41
41
  <script type="text/javascript">
42
- RED.nodes.registerType('periph-apa102', {
42
+ RED.nodes.registerType('apa102', {
43
43
  category: 'Peripheral',
44
44
  color: '#C084FC',
45
45
  defaults: {
@@ -54,7 +54,7 @@
54
54
  });
55
55
  </script>
56
56
 
57
- <script type="text/html" data-template-name="periph-apa102">
57
+ <script type="text/html" data-template-name="apa102">
58
58
  <div class="form-row">
59
59
  <label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
60
60
  <input type="text" id="node-input-device">
@@ -65,7 +65,7 @@
65
65
  </div>
66
66
  </script>
67
67
 
68
- <script type="text/html" data-help-name="periph-apa102">
68
+ <script type="text/html" data-help-name="apa102">
69
69
  <p>Controls an APA102 addressable RGB LED strip over SPI (synchronous two-wire protocol).</p>
70
70
  <p>Any input message triggers a strip update. Configure SPI bus, device, pixel count,
71
71
  and default brightness in the <b>apa102-device</b> config node.</p>
@@ -70,5 +70,5 @@ module.exports = function(RED) {
70
70
  }
71
71
  });
72
72
  }
73
- RED.nodes.registerType('periph-apa102', APA102WriteNode);
73
+ RED.nodes.registerType('apa102', APA102WriteNode);
74
74
  };
@@ -39,7 +39,7 @@
39
39
 
40
40
  <!-- Node: pixels / raw RAM / brightness / blink / key matrix -->
41
41
  <script type="text/javascript">
42
- RED.nodes.registerType('periph-ht16k33', {
42
+ RED.nodes.registerType('ht16k33', {
43
43
  category: 'Peripheral',
44
44
  color: '#C084FC',
45
45
  defaults: {
@@ -54,7 +54,7 @@
54
54
  });
55
55
  </script>
56
56
 
57
- <script type="text/html" data-template-name="periph-ht16k33">
57
+ <script type="text/html" data-template-name="ht16k33">
58
58
  <div class="form-row">
59
59
  <label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
60
60
  <input type="text" id="node-input-device">
@@ -65,7 +65,7 @@
65
65
  </div>
66
66
  </script>
67
67
 
68
- <script type="text/html" data-help-name="periph-ht16k33">
68
+ <script type="text/html" data-help-name="ht16k33">
69
69
  <p>Controls a HT16K33 16 × 8 LED matrix driver over I²C: set pixels, write the display RAM, change brightness and blink rate, and read the 13 × 3 key matrix.</p>
70
70
  <p>The device is configured via a <b>ht16k33-device</b> config node.</p>
71
71
 
@@ -68,5 +68,5 @@ module.exports = function(RED) {
68
68
  }
69
69
  });
70
70
  }
71
- RED.nodes.registerType('periph-ht16k33', HT16K33Node);
71
+ RED.nodes.registerType('ht16k33', HT16K33Node);
72
72
  };
@@ -35,7 +35,7 @@
35
35
 
36
36
  <!-- Node: pixels / fill / clear -->
37
37
  <script type="text/javascript">
38
- RED.nodes.registerType('periph-is31fl3731', {
38
+ RED.nodes.registerType('is31fl3731', {
39
39
  category: 'Peripheral',
40
40
  color: '#C084FC',
41
41
  defaults: {
@@ -50,7 +50,7 @@
50
50
  });
51
51
  </script>
52
52
 
53
- <script type="text/html" data-template-name="periph-is31fl3731">
53
+ <script type="text/html" data-template-name="is31fl3731">
54
54
  <div class="form-row">
55
55
  <label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
56
56
  <input type="text" id="node-input-device">
@@ -61,7 +61,7 @@
61
61
  </div>
62
62
  </script>
63
63
 
64
- <script type="text/html" data-help-name="periph-is31fl3731">
64
+ <script type="text/html" data-help-name="is31fl3731">
65
65
  <p>Controls an IS31FL3731 144-LED matrix driver (9 × 16, 8-bit PWM per LED) over I²C. The node draws into frame 1 in Picture mode.</p>
66
66
  <p>The device is configured via a <b>is31fl3731-device</b> config node.</p>
67
67
 
@@ -60,5 +60,5 @@ module.exports = function(RED) {
60
60
  }
61
61
  });
62
62
  }
63
- RED.nodes.registerType('periph-is31fl3731', IS31FL3731Node);
63
+ RED.nodes.registerType('is31fl3731', IS31FL3731Node);
64
64
  };
@@ -35,7 +35,7 @@
35
35
 
36
36
  <!-- Node: duty / pulse width / frequency -->
37
37
  <script type="text/javascript">
38
- RED.nodes.registerType('periph-pca9685', {
38
+ RED.nodes.registerType('pca9685', {
39
39
  category: 'Peripheral',
40
40
  color: '#C084FC',
41
41
  defaults: {
@@ -50,7 +50,7 @@
50
50
  });
51
51
  </script>
52
52
 
53
- <script type="text/html" data-template-name="periph-pca9685">
53
+ <script type="text/html" data-template-name="pca9685">
54
54
  <div class="form-row">
55
55
  <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
56
56
  <input type="text" id="node-input-name" placeholder="Name">
@@ -61,7 +61,7 @@
61
61
  </div>
62
62
  </script>
63
63
 
64
- <script type="text/html" data-help-name="periph-pca9685">
64
+ <script type="text/html" data-help-name="pca9685">
65
65
  <p>Controls the 16 PWM channels of a PCA9685 (12-bit, 24–1526 Hz) over I²C.</p>
66
66
  <h3>Inputs</h3>
67
67
  <dl class="message-properties">
@@ -72,5 +72,5 @@ module.exports = function(RED) {
72
72
  }
73
73
  });
74
74
  }
75
- RED.nodes.registerType('periph-pca9685', PCA9685Node);
75
+ RED.nodes.registerType('pca9685', PCA9685Node);
76
76
  };
@@ -39,7 +39,7 @@
39
39
  </script>
40
40
 
41
41
  <script type="text/javascript">
42
- RED.nodes.registerType('periph-sk6812rgbw', {
42
+ RED.nodes.registerType('sk6812rgbw', {
43
43
  category: 'Peripheral',
44
44
  color: '#C084FC',
45
45
  defaults: {
@@ -54,7 +54,7 @@
54
54
  });
55
55
  </script>
56
56
 
57
- <script type="text/html" data-template-name="periph-sk6812rgbw">
57
+ <script type="text/html" data-template-name="sk6812rgbw">
58
58
  <div class="form-row">
59
59
  <label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
60
60
  <input type="text" id="node-input-device">
@@ -65,7 +65,7 @@
65
65
  </div>
66
66
  </script>
67
67
 
68
- <script type="text/html" data-help-name="periph-sk6812rgbw">
68
+ <script type="text/html" data-help-name="sk6812rgbw">
69
69
  <p>Controls an SK6812RGBW addressable RGBW LED strip over SPI (NeoPixel protocol).</p>
70
70
  <p>Any input message triggers a strip update. Configure SPI bus, device, pixel count,
71
71
  and default brightness in the <b>sk6812rgbw-device</b> config node.</p>
@@ -68,5 +68,5 @@ module.exports = function(RED) {
68
68
  }
69
69
  });
70
70
  }
71
- RED.nodes.registerType('periph-sk6812rgbw', SK6812RGBWWriteNode);
71
+ RED.nodes.registerType('sk6812rgbw', SK6812RGBWWriteNode);
72
72
  };
@@ -39,7 +39,7 @@
39
39
  </script>
40
40
 
41
41
  <script type="text/javascript">
42
- RED.nodes.registerType('periph-ws2812b', {
42
+ RED.nodes.registerType('ws2812b', {
43
43
  category: 'Peripheral',
44
44
  color: '#C084FC',
45
45
  defaults: {
@@ -54,7 +54,7 @@
54
54
  });
55
55
  </script>
56
56
 
57
- <script type="text/html" data-template-name="periph-ws2812b">
57
+ <script type="text/html" data-template-name="ws2812b">
58
58
  <div class="form-row">
59
59
  <label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
60
60
  <input type="text" id="node-input-device">
@@ -65,7 +65,7 @@
65
65
  </div>
66
66
  </script>
67
67
 
68
- <script type="text/html" data-help-name="periph-ws2812b">
68
+ <script type="text/html" data-help-name="ws2812b">
69
69
  <p>Controls a WS2812B addressable RGB LED strip over SPI (NeoPixel protocol).</p>
70
70
  <p>Any input message triggers a strip update. Configure SPI bus, device, pixel count,
71
71
  and default brightness in the <b>ws2812b-device</b> config node.</p>
@@ -67,5 +67,5 @@ module.exports = function(RED) {
67
67
  }
68
68
  });
69
69
  }
70
- RED.nodes.registerType('periph-ws2812b', WS2812BWriteNode);
70
+ RED.nodes.registerType('ws2812b', WS2812BWriteNode);
71
71
  };
@@ -39,7 +39,7 @@
39
39
  </script>
40
40
 
41
41
  <script type="text/javascript">
42
- RED.nodes.registerType('periph-ws2814', {
42
+ RED.nodes.registerType('ws2814', {
43
43
  category: 'Peripheral',
44
44
  color: '#C084FC',
45
45
  defaults: {
@@ -54,7 +54,7 @@
54
54
  });
55
55
  </script>
56
56
 
57
- <script type="text/html" data-template-name="periph-ws2814">
57
+ <script type="text/html" data-template-name="ws2814">
58
58
  <div class="form-row">
59
59
  <label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
60
60
  <input type="text" id="node-input-device">
@@ -65,7 +65,7 @@
65
65
  </div>
66
66
  </script>
67
67
 
68
- <script type="text/html" data-help-name="periph-ws2814">
68
+ <script type="text/html" data-help-name="ws2814">
69
69
  <p>Controls a WS2814 addressable RGBW LED strip over SPI (NeoPixel protocol).</p>
70
70
  <p>Any input message triggers a strip update. Configure SPI bus, device, pixel count,
71
71
  and default brightness in the <b>ws2814-device</b> config node.</p>
@@ -68,5 +68,5 @@ module.exports = function(RED) {
68
68
  }
69
69
  });
70
70
  }
71
- RED.nodes.registerType('periph-ws2814', WS2814WriteNode);
71
+ RED.nodes.registerType('ws2814', WS2814WriteNode);
72
72
  };
package/package.json CHANGED
@@ -1,22 +1,33 @@
1
1
  {
2
2
  "name": "node-red-contrib-periph-led",
3
- "version": "1.5.1",
4
- "description": "Node-RED nodes for LED driver chips",
3
+ "version": "1.5.3",
4
+ "description": "Node-RED nodes for LED driver chips: APA102, HT16K33, IS31FL3731, PCA9685, SK6812RGBW, WS2812B, WS2814",
5
5
  "keywords": [
6
6
  "node-red",
7
7
  "led",
8
8
  "i2c",
9
9
  "spi",
10
10
  "sensor",
11
- "peripheral"
11
+ "peripheral",
12
+ "node-red-contrib",
13
+ "apa102",
14
+ "ht16k33",
15
+ "is31fl3731",
16
+ "pca9685",
17
+ "sk6812rgbw",
18
+ "ws2812b",
19
+ "ws2814"
12
20
  ],
13
21
  "node-red": {
22
+ "version": ">=3.0.0",
14
23
  "nodes": {
15
- "ws2812b": "nodes/ws2812b/ws2812b.js",
16
24
  "apa102": "nodes/apa102/apa102.js",
17
25
  "ht16k33": "nodes/ht16k33/ht16k33.js",
18
26
  "is31fl3731": "nodes/is31fl3731/is31fl3731.js",
19
- "pca9685": "nodes/pca9685/pca9685.js"
27
+ "pca9685": "nodes/pca9685/pca9685.js",
28
+ "sk6812rgbw": "nodes/sk6812rgbw/sk6812rgbw.js",
29
+ "ws2812b": "nodes/ws2812b/ws2812b.js",
30
+ "ws2814": "nodes/ws2814/ws2814.js"
20
31
  }
21
32
  },
22
33
  "dependencies": {
package/index.js DELETED
@@ -1,11 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- module.exports = function(RED) {
5
- const nodesDir = path.join(__dirname, 'nodes');
6
- if (!fs.existsSync(nodesDir)) return;
7
- fs.readdirSync(nodesDir).forEach(function(chip) {
8
- const nodeFile = path.join(nodesDir, chip, chip + '.js');
9
- if (fs.existsSync(nodeFile)) require(nodeFile)(RED);
10
- });
11
- };