node-red-contrib-periph-imu 1.3.2 → 1.4.0

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
@@ -16,8 +16,10 @@ npm install node-red-contrib-periph-imu
16
16
 
17
17
  | Node | Kind | Description |
18
18
  |------|------|-------------|
19
+ | `periph-icm20948` | input | Reads acceleration, angular rate, die temperature and (optionally) the magnetic field from a TDK InvenSense ICM-20948 9-axis MotionTracking device over I²C. The AK09916 magnetometer is read through the chip's own I²C master, so only one I²C address is needed. VDDIO must be 1.71–1.95 V. |
19
20
  | `mpu6050-device` | config | I²C bus and address for a MPU6050 |
20
21
  | `mpu6050` | input | Reads 3-axis acceleration and 3-axis angular rate from an MPU6050 IMU over I²C. |
22
+ | `periph-qmi8658a` | input | Reads acceleration, angular rate and die temperature from a QST QMI8658A 6-axis IMU over I²C (0x6B with SA0 = GND, 0x6A with SA0 = VDDIO) or 4-wire SPI. The three values come from one 14-byte burst, so they belong to the same sample. |
21
23
 
22
24
  ## Links
23
25
 
@@ -0,0 +1,87 @@
1
+ [
2
+ {
3
+ "id": "icm20948-tab",
4
+ "type": "tab",
5
+ "label": "ICM-20948 compass",
6
+ "disabled": false,
7
+ "info": "Reads an ICM-20948 every 100 ms and computes roll, pitch and a tilt-compensated heading from the acceleration and magnetic field — a 9-axis compass. The magnetometer frame is rotated 180° about X relative to the accelerometer frame, so (mx, -my, -mz) is used before tilt compensation."
8
+ },
9
+ {
10
+ "id": "icm20948-inject",
11
+ "type": "inject",
12
+ "z": "icm20948-tab",
13
+ "name": "100 ms timer",
14
+ "props": [
15
+ {
16
+ "p": "payload"
17
+ }
18
+ ],
19
+ "repeat": "0.1",
20
+ "crontab": "",
21
+ "once": false,
22
+ "onceDelay": 0.1,
23
+ "topic": "",
24
+ "payloadType": "date",
25
+ "x": 170,
26
+ "y": 160,
27
+ "wires": [
28
+ [
29
+ "icm20948-node"
30
+ ]
31
+ ]
32
+ },
33
+ {
34
+ "id": "icm20948-node",
35
+ "type": "periph-icm20948",
36
+ "z": "icm20948-tab",
37
+ "name": "ICM-20948",
38
+ "bus": "1",
39
+ "address": "0x68",
40
+ "accelRange": "1",
41
+ "gyroRange": "1",
42
+ "mag": true,
43
+ "x": 400,
44
+ "y": 160,
45
+ "wires": [
46
+ [
47
+ "icm20948-compass"
48
+ ]
49
+ ]
50
+ },
51
+ {
52
+ "id": "icm20948-compass",
53
+ "type": "function",
54
+ "z": "icm20948-tab",
55
+ "name": "Roll, pitch, tilt-compensated heading",
56
+ "func": "const { accel, gyro, mag } = msg.payload;\nconst roll = Math.atan2(accel.y, accel.z);\nconst pitch = Math.atan2(-accel.x, Math.sqrt(accel.y * accel.y + accel.z * accel.z));\n// map the magnetometer frame into the accelerometer frame\nconst bx = mag.x, by = -mag.y, bz = -mag.z;\nconst xh = bx * Math.cos(pitch) + bz * Math.sin(pitch);\nconst yh = bx * Math.sin(roll) * Math.sin(pitch) + by * Math.cos(roll) - bz * Math.sin(roll) * Math.cos(pitch);\nconst heading = (Math.atan2(-yh, xh) * 180 / Math.PI + 360) % 360;\nmsg.payload = {\n roll: roll * 180 / Math.PI,\n pitch: pitch * 180 / Math.PI,\n heading,\n gyroMagnitude: Math.sqrt(gyro.x * gyro.x + gyro.y * gyro.y + gyro.z * gyro.z)\n};\nreturn msg;",
57
+ "outputs": 1,
58
+ "noerr": 0,
59
+ "initialize": "",
60
+ "finalize": "",
61
+ "libs": [],
62
+ "x": 690,
63
+ "y": 160,
64
+ "wires": [
65
+ [
66
+ "icm20948-debug"
67
+ ]
68
+ ]
69
+ },
70
+ {
71
+ "id": "icm20948-debug",
72
+ "type": "debug",
73
+ "z": "icm20948-tab",
74
+ "name": "Compass",
75
+ "active": true,
76
+ "tosidebar": true,
77
+ "console": false,
78
+ "tostatus": false,
79
+ "complete": "payload",
80
+ "targetType": "msg",
81
+ "statusVal": "",
82
+ "statusType": "auto",
83
+ "x": 940,
84
+ "y": 160,
85
+ "wires": []
86
+ }
87
+ ]
@@ -0,0 +1,89 @@
1
+ [
2
+ {
3
+ "id": "qmi8658a-tab",
4
+ "type": "tab",
5
+ "label": "QMI8658A tilt estimator",
6
+ "disabled": false,
7
+ "info": "Reads a QMI8658A every 100 ms and estimates roll and pitch with a complementary filter: the gyro rate is integrated for the fast response and the accelerometer gravity vector (roll/pitch from atan2) corrects the slow drift. Demonstrates 6-DOF tilt estimation. The function node keeps its state in the node context, so the first message after deploy starts from the accelerometer-only angles."
8
+ },
9
+ {
10
+ "id": "qmi8658a-inject",
11
+ "type": "inject",
12
+ "z": "qmi8658a-tab",
13
+ "name": "100 ms timer",
14
+ "props": [
15
+ {
16
+ "p": "payload"
17
+ }
18
+ ],
19
+ "repeat": "0.1",
20
+ "crontab": "",
21
+ "once": false,
22
+ "onceDelay": 0.1,
23
+ "topic": "",
24
+ "payloadType": "date",
25
+ "x": 170,
26
+ "y": 160,
27
+ "wires": [
28
+ [
29
+ "qmi8658a-node"
30
+ ]
31
+ ]
32
+ },
33
+ {
34
+ "id": "qmi8658a-node",
35
+ "type": "periph-qmi8658a",
36
+ "z": "qmi8658a-tab",
37
+ "name": "QMI8658A",
38
+ "transport": "i2c",
39
+ "bus": "1",
40
+ "device": "0",
41
+ "address": "0x6B",
42
+ "accelRange": "1",
43
+ "gyroRange": "4",
44
+ "odr": "5",
45
+ "x": 400,
46
+ "y": 160,
47
+ "wires": [
48
+ [
49
+ "qmi8658a-tilt"
50
+ ]
51
+ ]
52
+ },
53
+ {
54
+ "id": "qmi8658a-tilt",
55
+ "type": "function",
56
+ "z": "qmi8658a-tab",
57
+ "name": "Complementary-filter roll/pitch",
58
+ "func": "const { accel, gyro, temperature } = msg.payload;\nconst now = Date.now();\nconst last = context.get('t') || now;\nconst dt = Math.min(0.5, (now - last) / 1000);\ncontext.set('t', now);\nconst D = 180 / Math.PI;\n// accelerometer-only angles (degrees)\nconst accRoll = Math.atan2(accel.y, accel.z) * D;\nconst accPitch = Math.atan2(-accel.x, Math.sqrt(accel.y * accel.y + accel.z * accel.z)) * D;\nlet roll = context.get('roll');\nlet pitch = context.get('pitch');\nif (roll === undefined) { roll = accRoll; pitch = accPitch; }\nconst alpha = 0.98;\nroll = alpha * (roll + gyro.x * D * dt) + (1 - alpha) * accRoll;\npitch = alpha * (pitch + gyro.y * D * dt) + (1 - alpha) * accPitch;\ncontext.set('roll', roll);\ncontext.set('pitch', pitch);\nmsg.payload = { roll, pitch, temperature };\nreturn msg;",
59
+ "outputs": 1,
60
+ "noerr": 0,
61
+ "initialize": "",
62
+ "finalize": "",
63
+ "libs": [],
64
+ "x": 700,
65
+ "y": 160,
66
+ "wires": [
67
+ [
68
+ "qmi8658a-debug"
69
+ ]
70
+ ]
71
+ },
72
+ {
73
+ "id": "qmi8658a-debug",
74
+ "type": "debug",
75
+ "z": "qmi8658a-tab",
76
+ "name": "Tilt",
77
+ "active": true,
78
+ "tosidebar": true,
79
+ "console": false,
80
+ "tostatus": false,
81
+ "complete": "payload",
82
+ "targetType": "msg",
83
+ "statusVal": "",
84
+ "statusType": "auto",
85
+ "x": 930,
86
+ "y": 160,
87
+ "wires": []
88
+ }
89
+ ]
@@ -0,0 +1,88 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('periph-icm20948', {
3
+ category: 'Peripheral',
4
+ color: '#C084FC',
5
+ defaults: {
6
+ name: { value: '' },
7
+ bus: { value: '1', required: true, validate: RED.validators.number() },
8
+ address: { value: '0x68', required: true },
9
+ accelRange: { value: '0', required: true, validate: RED.validators.number() },
10
+ gyroRange: { value: '0', required: true, validate: RED.validators.number() },
11
+ mag: { value: true }
12
+ },
13
+ inputs: 1,
14
+ outputs: 1,
15
+ icon: 'bridge.svg',
16
+ label: function() {
17
+ return this.name || ('ICM-20948 @ ' + this.address + ' (bus ' + this.bus + ')');
18
+ }
19
+ });
20
+ </script>
21
+
22
+ <script type="text/html" data-template-name="periph-icm20948">
23
+ <div class="form-row">
24
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
25
+ <input type="text" id="node-input-name" placeholder="ICM-20948">
26
+ </div>
27
+ <div class="form-row">
28
+ <label for="node-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
29
+ <input type="number" id="node-input-bus" min="0" style="width:80px"> &nbsp;(Linux /dev/i2c-N)
30
+ </div>
31
+ <div class="form-row">
32
+ <label for="node-input-address"><i class="fa fa-microchip"></i> I²C address</label>
33
+ <select id="node-input-address" style="width:160px">
34
+ <option value="0x68" selected>0x68 (AD0 = GND)</option>
35
+ <option value="0x69">0x69 (AD0 = VDDIO)</option>
36
+ </select>
37
+ </div>
38
+ <div class="form-row">
39
+ <label for="node-input-accelRange"><i class="fa fa-cog"></i> Accelerometer range</label>
40
+ <select id="node-input-accelRange" style="width:120px">
41
+ <option value="0" selected>±2 g</option>
42
+ <option value="1">±4 g</option>
43
+ <option value="2">±8 g</option>
44
+ <option value="3">±16 g</option>
45
+ </select>
46
+ </div>
47
+ <div class="form-row">
48
+ <label for="node-input-gyroRange"><i class="fa fa-cog"></i> Gyroscope range</label>
49
+ <select id="node-input-gyroRange" style="width:120px">
50
+ <option value="0" selected>±250 dps</option>
51
+ <option value="1">±500 dps</option>
52
+ <option value="2">±1000 dps</option>
53
+ <option value="3">±2000 dps</option>
54
+ </select>
55
+ </div>
56
+ <div class="form-row">
57
+ <label for="node-input-mag"><i class="fa fa-magnet"></i> Magnetometer</label>
58
+ <input type="checkbox" id="node-input-mag" style="width:auto">
59
+ </div>
60
+ </script>
61
+
62
+ <script type="text/html" data-help-name="periph-icm20948">
63
+ <p>Reads acceleration, angular rate, die temperature and (optionally) the magnetic field from a TDK InvenSense
64
+ ICM-20948 9-axis MotionTracking device over I²C. The AK09916 magnetometer is read through the chip's own
65
+ I²C master, so only one I²C address is needed. VDDIO must be 1.71–1.95 V.</p>
66
+ <h3>Inputs</h3>
67
+ <dl class="message-properties">
68
+ <dt>payload <span class="property-type">any</span></dt>
69
+ <dd>Any incoming message triggers one coherent measurement.</dd>
70
+ </dl>
71
+ <h3>Outputs</h3>
72
+ <dl class="message-properties">
73
+ <dt>payload.accel <span class="property-type">object</span></dt>
74
+ <dd><code>{ x, y, z }</code> acceleration in m/s².</dd>
75
+ <dt>payload.gyro <span class="property-type">object</span></dt>
76
+ <dd><code>{ x, y, z }</code> angular rate in rad/s.</dd>
77
+ <dt>payload.mag <span class="property-type">object</span></dt>
78
+ <dd><code>{ x, y, z }</code> magnetic field in µT, as the chip reports it. Present only when the magnetometer
79
+ is enabled. The magnetometer frame is rotated 180° about X relative to the accelerometer frame; map it with
80
+ <code>(mx, -my, -mz)</code> before tilt compensation.</dd>
81
+ <dt>payload.temperature <span class="property-type">number</span></dt>
82
+ <dd>Die temperature in °C.</dd>
83
+ </dl>
84
+ <h3>Configuration</h3>
85
+ <p>I²C bus number, I²C address (<code>0x68</code> with AD0 = GND, <code>0x69</code> with AD0 = VDDIO),
86
+ accelerometer range (±2/±4/±8/±16 g), gyroscope range (±250/±500/±1000/±2000 dps) and whether to enable the
87
+ magnetometer.</p>
88
+ </script>
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ module.exports = function(RED) {
4
+ const { I2CConnection } = require('periph/src/connection/i2c');
5
+ const { ICM20948Full } = require('periph/src/chips/imu/icm20948');
6
+
7
+ function ICM20948Node(config) {
8
+ RED.nodes.createNode(this, config);
9
+ const node = this;
10
+ try {
11
+ const address = parseInt(config.address, 16) || 0x68;
12
+ const connection = new I2CConnection(parseInt(config.bus), address);
13
+ node.connection = connection;
14
+ node.driver = new ICM20948Full(connection);
15
+ // The driver initialises itself asynchronously; configure it once ready.
16
+ node.ready = (async () => {
17
+ await node.driver.init();
18
+ await node.driver.configureAccel(parseInt(config.accelRange) || 0);
19
+ await node.driver.configureGyro(parseInt(config.gyroRange) || 0);
20
+ if (config.mag) await node.driver.enableMag();
21
+ })();
22
+ node.ready.catch((e) => {
23
+ node.error('ICM20948 init failed: ' + e.message);
24
+ });
25
+ } catch (e) {
26
+ node.error('ICM20948 init failed: ' + e.message);
27
+ }
28
+
29
+ node.on('input', async function(msg, send, done) {
30
+ if (!node.driver) {
31
+ node.error('ICM20948 not initialised', msg);
32
+ done();
33
+ return;
34
+ }
35
+ try {
36
+ await node.ready;
37
+ const [accel, gyro, temperature] = await node.driver.readAll();
38
+ const payload = {
39
+ accel: { x: accel[0], y: accel[1], z: accel[2] },
40
+ gyro: { x: gyro[0], y: gyro[1], z: gyro[2] },
41
+ temperature,
42
+ };
43
+ if (config.mag) {
44
+ const [x, y, z] = await node.driver.mag();
45
+ payload.mag = { x, y, z };
46
+ }
47
+ msg.payload = payload;
48
+ send(msg);
49
+ done();
50
+ } catch (e) {
51
+ done(e);
52
+ }
53
+ });
54
+
55
+ node.on('close', function() {
56
+ if (node.connection) node.connection.close();
57
+ });
58
+ }
59
+ RED.nodes.registerType('periph-icm20948', ICM20948Node);
60
+ };
@@ -0,0 +1,119 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('periph-qmi8658a', {
3
+ category: 'Peripheral',
4
+ color: '#C084FC',
5
+ defaults: {
6
+ name: { value: '' },
7
+ transport: { value: 'i2c', required: true },
8
+ bus: { value: '1', required: true, validate: RED.validators.number() },
9
+ device: { value: '0' },
10
+ address: { value: '0x6B' },
11
+ accelRange: { value: '0', required: true, validate: RED.validators.number() },
12
+ gyroRange: { value: '4', required: true, validate: RED.validators.number() },
13
+ odr: { value: '5', required: true, validate: RED.validators.number() }
14
+ },
15
+ inputs: 1,
16
+ outputs: 1,
17
+ icon: 'bridge.svg',
18
+ label: function() {
19
+ return this.name || ('QMI8658A ' + (this.transport === 'spi' ? 'SPI ' + this.bus + '.' + this.device
20
+ : '@ ' + this.address + ' (bus ' + this.bus + ')'));
21
+ },
22
+ oneditprepare: function() {
23
+ function toggle() {
24
+ var spi = $('#node-input-transport').val() === 'spi';
25
+ $('.qmi-i2c').toggle(!spi);
26
+ $('.qmi-spi').toggle(spi);
27
+ }
28
+ $('#node-input-transport').on('change', toggle);
29
+ toggle();
30
+ }
31
+ });
32
+ </script>
33
+
34
+ <script type="text/html" data-template-name="periph-qmi8658a">
35
+ <div class="form-row">
36
+ <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
37
+ <input type="text" id="node-input-name" placeholder="QMI8658A">
38
+ </div>
39
+ <div class="form-row">
40
+ <label for="node-input-transport"><i class="fa fa-exchange"></i> Transport</label>
41
+ <select id="node-input-transport" style="width:120px">
42
+ <option value="i2c" selected>I²C</option>
43
+ <option value="spi">SPI</option>
44
+ </select>
45
+ </div>
46
+ <div class="form-row">
47
+ <label for="node-input-bus"><i class="fa fa-microchip"></i> Bus</label>
48
+ <input type="number" id="node-input-bus" min="0" style="width:80px"> &nbsp;(Linux /dev/i2c-N or /dev/spidevN.M)
49
+ </div>
50
+ <div class="form-row qmi-spi">
51
+ <label for="node-input-device"><i class="fa fa-microchip"></i> SPI device</label>
52
+ <input type="number" id="node-input-device" min="0" style="width:80px"> &nbsp;(chip select N in /dev/spidevB.N)
53
+ </div>
54
+ <div class="form-row qmi-i2c">
55
+ <label for="node-input-address"><i class="fa fa-microchip"></i> I²C address</label>
56
+ <select id="node-input-address" style="width:160px">
57
+ <option value="0x6B" selected>0x6B (SA0 = GND)</option>
58
+ <option value="0x6A">0x6A (SA0 = VDDIO)</option>
59
+ </select>
60
+ </div>
61
+ <div class="form-row">
62
+ <label for="node-input-accelRange"><i class="fa fa-cog"></i> Accelerometer range</label>
63
+ <select id="node-input-accelRange" style="width:120px">
64
+ <option value="0" selected>±2 g</option>
65
+ <option value="1">±4 g</option>
66
+ <option value="2">±8 g</option>
67
+ <option value="3">±16 g</option>
68
+ </select>
69
+ </div>
70
+ <div class="form-row">
71
+ <label for="node-input-gyroRange"><i class="fa fa-cog"></i> Gyroscope range</label>
72
+ <select id="node-input-gyroRange" style="width:120px">
73
+ <option value="0">±16 dps</option>
74
+ <option value="1">±32 dps</option>
75
+ <option value="2">±64 dps</option>
76
+ <option value="3">±128 dps</option>
77
+ <option value="4" selected>±256 dps</option>
78
+ <option value="5">±512 dps</option>
79
+ <option value="6">±1024 dps</option>
80
+ <option value="7">±2048 dps</option>
81
+ </select>
82
+ </div>
83
+ <div class="form-row">
84
+ <label for="node-input-odr"><i class="fa fa-clock-o"></i> Output data rate</label>
85
+ <select id="node-input-odr" style="width:120px">
86
+ <option value="8">28 Hz</option>
87
+ <option value="7">56 Hz</option>
88
+ <option value="6">112 Hz</option>
89
+ <option value="5" selected>224 Hz</option>
90
+ <option value="4">448 Hz</option>
91
+ <option value="3">897 Hz</option>
92
+ </select>
93
+ </div>
94
+ </script>
95
+
96
+ <script type="text/html" data-help-name="periph-qmi8658a">
97
+ <p>Reads acceleration, angular rate and die temperature from a QST QMI8658A 6-axis IMU over I²C (0x6B with
98
+ SA0 = GND, 0x6A with SA0 = VDDIO) or 4-wire SPI. The three values come from one 14-byte burst, so they belong
99
+ to the same sample.</p>
100
+ <h3>Inputs</h3>
101
+ <dl class="message-properties">
102
+ <dt>payload <span class="property-type">any</span></dt>
103
+ <dd>Any incoming message triggers one coherent measurement.</dd>
104
+ </dl>
105
+ <h3>Outputs</h3>
106
+ <dl class="message-properties">
107
+ <dt>payload.accel <span class="property-type">object</span></dt>
108
+ <dd><code>{ x, y, z }</code> acceleration in m/s².</dd>
109
+ <dt>payload.gyro <span class="property-type">object</span></dt>
110
+ <dd><code>{ x, y, z }</code> angular rate in rad/s.</dd>
111
+ <dt>payload.temperature <span class="property-type">number</span></dt>
112
+ <dd>Die temperature in °C (refreshed at 8 Hz).</dd>
113
+ </dl>
114
+ <h3>Configuration</h3>
115
+ <p>Transport (I²C or SPI), the I²C bus number or SPI bus and chip select, the I²C address, the accelerometer
116
+ range (±2/±4/±8/±16 g), the gyroscope range (±16 … ±2048 dps) and the output data rate (28 … 897 Hz, shared by
117
+ both sensors). Allow ≈165 ms after deploying before the first message — the gyroscope needs that long to
118
+ turn on.</p>
119
+ </script>
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+
3
+ module.exports = function(RED) {
4
+ const { I2CConnection } = require('periph/src/connection/i2c');
5
+ const { SPIConnection } = require('periph/src/connection/spi');
6
+ const { QMI8658AFull } = require('periph/src/chips/imu/qmi8658a');
7
+
8
+ function QMI8658ANode(config) {
9
+ RED.nodes.createNode(this, config);
10
+ const node = this;
11
+ try {
12
+ let connection;
13
+ if (config.transport === 'spi') {
14
+ // 4-wire SPI mode 3, read bit 0x80, no multi-byte bit (burst needs CTRL1.ADDR_AI, set by the driver).
15
+ connection = new SPIConnection(parseInt(config.bus), parseInt(config.device) || 0,
16
+ { mode: 3, readBit: 0x80, multiByteBit: null, maxSpeedHz: 10000000 });
17
+ } else {
18
+ const address = parseInt(config.address, 16) || 0x6B;
19
+ connection = new I2CConnection(parseInt(config.bus), address);
20
+ }
21
+ node.connection = connection;
22
+ node.driver = new QMI8658AFull(connection);
23
+ // The driver initialises itself asynchronously; configure it once ready.
24
+ node.ready = (async () => {
25
+ await node.driver.init();
26
+ const odr = parseInt(config.odr);
27
+ const code = Number.isNaN(odr) ? 5 : odr;
28
+ await node.driver.configureAccel(parseInt(config.accelRange) || 0, code);
29
+ await node.driver.configureGyro(Number.isNaN(parseInt(config.gyroRange)) ? 4 : parseInt(config.gyroRange), code);
30
+ await new Promise((r) => setTimeout(r, 165));
31
+ })();
32
+ node.ready.catch((e) => {
33
+ node.error('QMI8658A init failed: ' + e.message);
34
+ });
35
+ } catch (e) {
36
+ node.error('QMI8658A init failed: ' + e.message);
37
+ }
38
+
39
+ node.on('input', async function(msg, send, done) {
40
+ if (!node.driver) {
41
+ node.error('QMI8658A not initialised', msg);
42
+ done();
43
+ return;
44
+ }
45
+ try {
46
+ await node.ready;
47
+ const [accel, gyro, temperature] = await node.driver.readAll();
48
+ msg.payload = {
49
+ accel: { x: accel[0], y: accel[1], z: accel[2] },
50
+ gyro: { x: gyro[0], y: gyro[1], z: gyro[2] },
51
+ temperature,
52
+ };
53
+ send(msg);
54
+ done();
55
+ } catch (e) {
56
+ done(e);
57
+ }
58
+ });
59
+
60
+ node.on('close', function() {
61
+ if (node.connection) node.connection.close();
62
+ });
63
+ }
64
+ RED.nodes.registerType('periph-qmi8658a', QMI8658ANode);
65
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-periph-imu",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "Node-RED nodes for IMU chips",
5
5
  "keywords": [
6
6
  "node-red",
@@ -12,9 +12,11 @@
12
12
  ],
13
13
  "node-red": {
14
14
  "nodes": {
15
+ "icm20948": "nodes/icm20948/icm20948.js",
15
16
  "mpu6050": "nodes/mpu6050/mpu6050.js",
16
17
  "mpu9250": "nodes/mpu9250/mpu9250.js",
17
- "mpu9255": "nodes/mpu9255/mpu9255.js"
18
+ "mpu9255": "nodes/mpu9255/mpu9255.js",
19
+ "qmi8658a": "nodes/qmi8658a/qmi8658a.js"
18
20
  }
19
21
  },
20
22
  "dependencies": {