node-red-contrib-periph-adc-dac 1.5.1 → 1.5.2
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 +44 -26
- package/examples/ad5243/demo.json +11 -5
- package/examples/ad5248/demo.json +1 -1
- package/examples/ad5251/demo.json +11 -5
- package/examples/ad5252/demo.json +11 -5
- package/examples/ad7705/demo.json +1 -1
- package/examples/ad7706/demo.json +1 -1
- package/examples/ads1013/demo.json +1 -76
- package/examples/ads1014/demo.json +1 -77
- package/examples/ads1113/demo.json +10 -4
- package/examples/ads1114/demo.json +10 -4
- package/examples/ads1115/demo.json +11 -5
- package/examples/ads7828/demo.json +12 -6
- package/examples/cat5171/demo.json +10 -4
- package/examples/cs43l22/demo.json +13 -7
- package/examples/ds1881/demo.json +12 -6
- package/examples/ds3502/demo.json +11 -5
- package/examples/es8311/demo.json +1 -1
- package/examples/hx710a/demo.json +38 -10
- package/examples/hx710b/demo.json +56 -15
- package/examples/hx711/demo.json +32 -9
- package/examples/hy3131/demo.json +1 -1
- package/examples/mcp3422/demo.json +12 -6
- package/examples/mcp4725/demo.json +1 -1
- package/examples/mcp4728/demo.json +5 -5
- package/examples/mcp4xxx/demo.json +1 -1
- package/examples/pcf8591/demo.json +30 -8
- package/nodes/ad5243/ad5243.html +46 -20
- package/nodes/ad5243/ad5243.js +28 -22
- package/nodes/ad5248/ad5248.html +3 -3
- package/nodes/ad5248/ad5248.js +1 -1
- package/nodes/ad5251/ad5251.html +45 -19
- package/nodes/ad5251/ad5251.js +29 -23
- package/nodes/ad5252/ad5252.html +45 -19
- package/nodes/ad5252/ad5252.js +29 -23
- package/nodes/ad7705/ad7705.html +3 -3
- package/nodes/ad7705/ad7705.js +1 -1
- package/nodes/ad7706/ad7706.html +3 -3
- package/nodes/ad7706/ad7706.js +1 -1
- package/nodes/ads1013/ads1013.html +44 -18
- package/nodes/ads1013/ads1013.js +22 -16
- package/nodes/ads1014/ads1014.html +46 -20
- package/nodes/ads1014/ads1014.js +22 -16
- package/nodes/ads1113/ads1113.html +44 -18
- package/nodes/ads1113/ads1113.js +17 -8
- package/nodes/ads1114/ads1114.html +46 -20
- package/nodes/ads1114/ads1114.js +17 -8
- package/nodes/ads1115/ads1115.html +48 -22
- package/nodes/ads1115/ads1115.js +17 -8
- package/nodes/ads7828/ads7828.html +47 -21
- package/nodes/ads7828/ads7828.js +23 -17
- package/nodes/cat5171/cat5171.html +46 -20
- package/nodes/cat5171/cat5171.js +28 -22
- package/nodes/cs43l22/cs43l22.html +48 -22
- package/nodes/cs43l22/cs43l22.js +29 -22
- package/nodes/ds1881/ds1881.html +48 -22
- package/nodes/ds1881/ds1881.js +34 -27
- package/nodes/ds3502/ds3502.html +46 -20
- package/nodes/ds3502/ds3502.js +25 -19
- package/nodes/es8311/es8311.html +3 -3
- package/nodes/es8311/es8311.js +1 -1
- package/nodes/hx710a/hx710a.html +48 -22
- package/nodes/hx710a/hx710a.js +18 -13
- package/nodes/hx710b/hx710b.html +48 -22
- package/nodes/hx710b/hx710b.js +18 -13
- package/nodes/hx711/hx711.html +48 -22
- package/nodes/hx711/hx711.js +17 -12
- package/nodes/hy3131/hy3131.html +3 -3
- package/nodes/hy3131/hy3131.js +1 -1
- package/nodes/mcp3422/mcp3422.html +46 -20
- package/nodes/mcp3422/mcp3422.js +28 -22
- package/nodes/mcp4725/mcp4725.html +3 -3
- package/nodes/mcp4725/mcp4725.js +1 -1
- package/nodes/mcp4728/mcp4728.html +3 -3
- package/nodes/mcp4728/mcp4728.js +1 -1
- package/nodes/mcp4xxx/mcp4xxx.html +3 -3
- package/nodes/mcp4xxx/mcp4xxx.js +1 -1
- package/nodes/pcf8591/pcf8591.html +37 -11
- package/nodes/pcf8591/pcf8591.js +16 -7
- package/package.json +1 -1
- package/index.js +0 -11
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "tab",
|
|
5
5
|
"label": "DS1881 Volume Demo",
|
|
6
6
|
"disabled": false,
|
|
7
|
-
"info": "Stereo volume control with a DS1881 dual audio potentiometer. An Inject node ticks every 200 ms into a Function node that ramps the attenuation from 0 dB to 40 dB in 2 dB steps and back; the
|
|
7
|
+
"info": "Stereo volume control with a DS1881 dual audio potentiometer. An Inject node ticks every 200 ms into a Function node that ramps the attenuation from 0 dB to 40 dB in 2 dB steps and back; the ds1881 node sets both channels and returns {position0, position1, db0, db1}, which a Debug node shows. Two more Inject nodes send {mute: true} and {mute: false} (the last volume is restored on unmute), a third reads back both channels with the configuration, and a fourth sends {store: true} to persist the positions to EEPROM (the chip is rated for only 50 000 writes, so leave that one alone unless needed). The wipers are volatile by default, so after a power cycle both channels start muted until the ramp runs."
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"id": "inj-ramp",
|
|
@@ -123,13 +123,19 @@
|
|
|
123
123
|
]
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
|
-
"id": "ds1881-
|
|
127
|
-
"type": "
|
|
126
|
+
"id": "ds1881-device-1",
|
|
127
|
+
"type": "ds1881-device",
|
|
128
128
|
"name": "DS1881",
|
|
129
|
-
"
|
|
129
|
+
"address": "0x28",
|
|
130
130
|
"option": "1",
|
|
131
|
-
"zerocrossing": true,
|
|
132
131
|
"nonvolatile": false,
|
|
132
|
+
"zerocrossing": true,
|
|
133
|
+
"bus": "1"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"id": "ds1881-node",
|
|
137
|
+
"type": "ds1881",
|
|
138
|
+
"name": "DS1881",
|
|
133
139
|
"z": "tab-ds1881-demo",
|
|
134
140
|
"x": 560,
|
|
135
141
|
"y": 140,
|
|
@@ -138,7 +144,7 @@
|
|
|
138
144
|
"dbg-ds1881"
|
|
139
145
|
]
|
|
140
146
|
],
|
|
141
|
-
"
|
|
147
|
+
"device": "ds1881-device-1"
|
|
142
148
|
},
|
|
143
149
|
{
|
|
144
150
|
"id": "dbg-ds1881",
|
|
@@ -103,10 +103,18 @@
|
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
|
-
"id": "ds3502-
|
|
107
|
-
"type": "
|
|
106
|
+
"id": "ds3502-device-1",
|
|
107
|
+
"type": "ds3502-device",
|
|
108
108
|
"name": "DS3502",
|
|
109
|
+
"vhigh": "15",
|
|
109
110
|
"bus": "1",
|
|
111
|
+
"address": "0x28",
|
|
112
|
+
"vlow": "0"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "ds3502-node",
|
|
116
|
+
"type": "ds3502",
|
|
117
|
+
"name": "DS3502",
|
|
110
118
|
"z": "tab-ds3502-demo",
|
|
111
119
|
"x": 560,
|
|
112
120
|
"y": 140,
|
|
@@ -115,9 +123,7 @@
|
|
|
115
123
|
"dbg-ds3502"
|
|
116
124
|
]
|
|
117
125
|
],
|
|
118
|
-
"
|
|
119
|
-
"vhigh": "15",
|
|
120
|
-
"vlow": "0"
|
|
126
|
+
"device": "ds3502-device-1"
|
|
121
127
|
},
|
|
122
128
|
{
|
|
123
129
|
"id": "dbg-ds3502",
|
|
@@ -20,7 +20,11 @@
|
|
|
20
20
|
"z": "tab-hx710a-demo",
|
|
21
21
|
"x": 140,
|
|
22
22
|
"y": 100,
|
|
23
|
-
"wires": [
|
|
23
|
+
"wires": [
|
|
24
|
+
[
|
|
25
|
+
"hx710a"
|
|
26
|
+
]
|
|
27
|
+
]
|
|
24
28
|
},
|
|
25
29
|
{
|
|
26
30
|
"id": "inj-read",
|
|
@@ -36,7 +40,11 @@
|
|
|
36
40
|
"z": "tab-hx710a-demo",
|
|
37
41
|
"x": 140,
|
|
38
42
|
"y": 200,
|
|
39
|
-
"wires": [
|
|
43
|
+
"wires": [
|
|
44
|
+
[
|
|
45
|
+
"hx710a"
|
|
46
|
+
]
|
|
47
|
+
]
|
|
40
48
|
},
|
|
41
49
|
{
|
|
42
50
|
"id": "inj-temperature",
|
|
@@ -52,21 +60,37 @@
|
|
|
52
60
|
"z": "tab-hx710a-demo",
|
|
53
61
|
"x": 160,
|
|
54
62
|
"y": 300,
|
|
55
|
-
"wires": [
|
|
63
|
+
"wires": [
|
|
64
|
+
[
|
|
65
|
+
"hx710a"
|
|
66
|
+
]
|
|
67
|
+
]
|
|
56
68
|
},
|
|
57
69
|
{
|
|
58
|
-
"id": "hx710a",
|
|
59
|
-
"type": "
|
|
70
|
+
"id": "hx710a-device-1",
|
|
71
|
+
"type": "hx710a-device",
|
|
60
72
|
"name": "HX710A",
|
|
61
73
|
"doutPin": "5",
|
|
62
|
-
"pdSckPin": "6",
|
|
63
|
-
"rate": "10",
|
|
64
|
-
"scaleFactor": "420.0",
|
|
65
74
|
"tareOffset": "0",
|
|
75
|
+
"scaleFactor": "420.0",
|
|
76
|
+
"rate": "10",
|
|
77
|
+
"pdSckPin": "6"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "hx710a",
|
|
81
|
+
"type": "hx710a",
|
|
82
|
+
"name": "HX710A",
|
|
66
83
|
"z": "tab-hx710a-demo",
|
|
67
84
|
"x": 380,
|
|
68
85
|
"y": 200,
|
|
69
|
-
"wires": [
|
|
86
|
+
"wires": [
|
|
87
|
+
[
|
|
88
|
+
"dbg-weight",
|
|
89
|
+
"gauge-weight",
|
|
90
|
+
"dbg-temperature"
|
|
91
|
+
]
|
|
92
|
+
],
|
|
93
|
+
"device": "hx710a-device-1"
|
|
70
94
|
},
|
|
71
95
|
{
|
|
72
96
|
"id": "dbg-weight",
|
|
@@ -99,7 +123,11 @@
|
|
|
99
123
|
"format": "{{payload.weight | number:1}}",
|
|
100
124
|
"min": "0",
|
|
101
125
|
"max": "1000",
|
|
102
|
-
"colors": [
|
|
126
|
+
"colors": [
|
|
127
|
+
"#00b500",
|
|
128
|
+
"#e6e600",
|
|
129
|
+
"#ca3838"
|
|
130
|
+
],
|
|
103
131
|
"seg1": "500",
|
|
104
132
|
"seg2": "800",
|
|
105
133
|
"className": "",
|
|
@@ -20,7 +20,11 @@
|
|
|
20
20
|
"z": "tab-hx710b-demo",
|
|
21
21
|
"x": 140,
|
|
22
22
|
"y": 100,
|
|
23
|
-
"wires": [
|
|
23
|
+
"wires": [
|
|
24
|
+
[
|
|
25
|
+
"hx710b"
|
|
26
|
+
]
|
|
27
|
+
]
|
|
24
28
|
},
|
|
25
29
|
{
|
|
26
30
|
"id": "inj-read-hx710b",
|
|
@@ -36,7 +40,11 @@
|
|
|
36
40
|
"z": "tab-hx710b-demo",
|
|
37
41
|
"x": 140,
|
|
38
42
|
"y": 200,
|
|
39
|
-
"wires": [
|
|
43
|
+
"wires": [
|
|
44
|
+
[
|
|
45
|
+
"hx710b"
|
|
46
|
+
]
|
|
47
|
+
]
|
|
40
48
|
},
|
|
41
49
|
{
|
|
42
50
|
"id": "inj-supply-diff-hx710b",
|
|
@@ -52,22 +60,38 @@
|
|
|
52
60
|
"z": "tab-hx710b-demo",
|
|
53
61
|
"x": 140,
|
|
54
62
|
"y": 300,
|
|
55
|
-
"wires": [
|
|
63
|
+
"wires": [
|
|
64
|
+
[
|
|
65
|
+
"hx710b"
|
|
66
|
+
]
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "hx710b-device-1",
|
|
71
|
+
"type": "hx710b-device",
|
|
72
|
+
"name": "HX710B",
|
|
73
|
+
"doutPin": "5",
|
|
74
|
+
"gpioChip": "0",
|
|
75
|
+
"tareOffset": "0",
|
|
76
|
+
"scaleFactor": "1.0",
|
|
77
|
+
"rate": "10",
|
|
78
|
+
"pdSckPin": "6"
|
|
56
79
|
},
|
|
57
80
|
{
|
|
58
81
|
"id": "hx710b",
|
|
59
|
-
"type": "
|
|
82
|
+
"type": "hx710b",
|
|
60
83
|
"z": "tab-hx710b-demo",
|
|
61
84
|
"name": "",
|
|
62
|
-
"gpioChip": "0",
|
|
63
|
-
"doutPin": "5",
|
|
64
|
-
"pdSckPin": "6",
|
|
65
|
-
"rate": "10",
|
|
66
|
-
"scaleFactor": "1.0",
|
|
67
|
-
"tareOffset": "0",
|
|
68
85
|
"x": 360,
|
|
69
86
|
"y": 200,
|
|
70
|
-
"wires": [
|
|
87
|
+
"wires": [
|
|
88
|
+
[
|
|
89
|
+
"dbg-weight-hx710b",
|
|
90
|
+
"gauge-weight-hx710b",
|
|
91
|
+
"switch-supply-diff-hx710b"
|
|
92
|
+
]
|
|
93
|
+
],
|
|
94
|
+
"device": "hx710b-device-1"
|
|
71
95
|
},
|
|
72
96
|
{
|
|
73
97
|
"id": "dbg-weight-hx710b",
|
|
@@ -99,7 +123,11 @@
|
|
|
99
123
|
"format": "{{value}}",
|
|
100
124
|
"min": 0,
|
|
101
125
|
"max": 1000,
|
|
102
|
-
"colors": [
|
|
126
|
+
"colors": [
|
|
127
|
+
"#00b500",
|
|
128
|
+
"#e6e600",
|
|
129
|
+
"#ca3838"
|
|
130
|
+
],
|
|
103
131
|
"seg1": "",
|
|
104
132
|
"seg2": "",
|
|
105
133
|
"x": 580,
|
|
@@ -132,15 +160,28 @@
|
|
|
132
160
|
"property": "payload.raw_supply_diff",
|
|
133
161
|
"propertyType": "msg",
|
|
134
162
|
"rules": [
|
|
135
|
-
{
|
|
136
|
-
|
|
163
|
+
{
|
|
164
|
+
"t": "lt",
|
|
165
|
+
"v": "-50000",
|
|
166
|
+
"vt": "num"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"t": "gt",
|
|
170
|
+
"v": "50000",
|
|
171
|
+
"vt": "num"
|
|
172
|
+
}
|
|
137
173
|
],
|
|
138
174
|
"checkall": "false",
|
|
139
175
|
"repair": false,
|
|
140
176
|
"outputs": 2,
|
|
141
177
|
"x": 580,
|
|
142
178
|
"y": 300,
|
|
143
|
-
"wires": [
|
|
179
|
+
"wires": [
|
|
180
|
+
[
|
|
181
|
+
"notify-low-batt-hx710b"
|
|
182
|
+
],
|
|
183
|
+
[]
|
|
184
|
+
]
|
|
144
185
|
},
|
|
145
186
|
{
|
|
146
187
|
"id": "notify-low-batt-hx710b",
|
package/examples/hx711/demo.json
CHANGED
|
@@ -20,7 +20,11 @@
|
|
|
20
20
|
"z": "tab-hx711-demo",
|
|
21
21
|
"x": 140,
|
|
22
22
|
"y": 100,
|
|
23
|
-
"wires": [
|
|
23
|
+
"wires": [
|
|
24
|
+
[
|
|
25
|
+
"hx711"
|
|
26
|
+
]
|
|
27
|
+
]
|
|
24
28
|
},
|
|
25
29
|
{
|
|
26
30
|
"id": "inj-read",
|
|
@@ -36,21 +40,36 @@
|
|
|
36
40
|
"z": "tab-hx711-demo",
|
|
37
41
|
"x": 140,
|
|
38
42
|
"y": 200,
|
|
39
|
-
"wires": [
|
|
43
|
+
"wires": [
|
|
44
|
+
[
|
|
45
|
+
"hx711"
|
|
46
|
+
]
|
|
47
|
+
]
|
|
40
48
|
},
|
|
41
49
|
{
|
|
42
|
-
"id": "hx711",
|
|
43
|
-
"type": "
|
|
50
|
+
"id": "hx711-device-1",
|
|
51
|
+
"type": "hx711-device",
|
|
44
52
|
"name": "HX711",
|
|
45
53
|
"doutPin": "5",
|
|
46
|
-
"pdSckPin": "6",
|
|
47
|
-
"gain": "128",
|
|
48
|
-
"scaleFactor": "420.0",
|
|
49
54
|
"tareOffset": "0",
|
|
55
|
+
"scaleFactor": "420.0",
|
|
56
|
+
"gain": "128",
|
|
57
|
+
"pdSckPin": "6"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "hx711",
|
|
61
|
+
"type": "hx711",
|
|
62
|
+
"name": "HX711",
|
|
50
63
|
"z": "tab-hx711-demo",
|
|
51
64
|
"x": 360,
|
|
52
65
|
"y": 200,
|
|
53
|
-
"wires": [
|
|
66
|
+
"wires": [
|
|
67
|
+
[
|
|
68
|
+
"dbg-weight",
|
|
69
|
+
"gauge-weight"
|
|
70
|
+
]
|
|
71
|
+
],
|
|
72
|
+
"device": "hx711-device-1"
|
|
54
73
|
},
|
|
55
74
|
{
|
|
56
75
|
"id": "dbg-weight",
|
|
@@ -83,7 +102,11 @@
|
|
|
83
102
|
"format": "{{payload.weight | number:1}}",
|
|
84
103
|
"min": "0",
|
|
85
104
|
"max": "1000",
|
|
86
|
-
"colors": [
|
|
105
|
+
"colors": [
|
|
106
|
+
"#00b500",
|
|
107
|
+
"#e6e600",
|
|
108
|
+
"#ca3838"
|
|
109
|
+
],
|
|
87
110
|
"seg1": "500",
|
|
88
111
|
"seg2": "800",
|
|
89
112
|
"className": "",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "tab",
|
|
5
5
|
"label": "MCP3422 Two-Channel Demo",
|
|
6
6
|
"disabled": false,
|
|
7
|
-
"info": "Inject node (every 2 s) into
|
|
7
|
+
"info": "Inject node (every 2 s) into mcp3422 (16 bit, x1); a function node splits payload.channels into two messages with topics ch1 and ch2 for the chart / debug nodes. A second inject sends gain = 8 and resolution = 18 for a bridge-sensor measurement."
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"id": "inj-scan",
|
|
@@ -59,13 +59,18 @@
|
|
|
59
59
|
]
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
|
-
"id": "mcp3422-
|
|
63
|
-
"type": "
|
|
62
|
+
"id": "mcp3422-device-1",
|
|
63
|
+
"type": "mcp3422-device",
|
|
64
64
|
"name": "MCP3422",
|
|
65
|
+
"gain": "1",
|
|
65
66
|
"bus": "1",
|
|
66
67
|
"address": "0x68",
|
|
67
|
-
"resolution": "16"
|
|
68
|
-
|
|
68
|
+
"resolution": "16"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"id": "mcp3422-node",
|
|
72
|
+
"type": "mcp3422",
|
|
73
|
+
"name": "MCP3422",
|
|
69
74
|
"z": "tab-mcp3422-demo",
|
|
70
75
|
"x": 380,
|
|
71
76
|
"y": 140,
|
|
@@ -73,7 +78,8 @@
|
|
|
73
78
|
[
|
|
74
79
|
"fn-split"
|
|
75
80
|
]
|
|
76
|
-
]
|
|
81
|
+
],
|
|
82
|
+
"device": "mcp3422-device-1"
|
|
77
83
|
},
|
|
78
84
|
{
|
|
79
85
|
"id": "fn-split",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
"id": "mcp4728-A",
|
|
98
|
-
"type": "
|
|
98
|
+
"type": "mcp4728",
|
|
99
99
|
"name": "MCP4728 A",
|
|
100
100
|
"device": "cfg-mcp4728",
|
|
101
101
|
"channel": "A",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
112
|
"id": "mcp4728-B",
|
|
113
|
-
"type": "
|
|
113
|
+
"type": "mcp4728",
|
|
114
114
|
"name": "MCP4728 B",
|
|
115
115
|
"device": "cfg-mcp4728",
|
|
116
116
|
"channel": "B",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
"id": "mcp4728-C",
|
|
128
|
-
"type": "
|
|
128
|
+
"type": "mcp4728",
|
|
129
129
|
"name": "MCP4728 C",
|
|
130
130
|
"device": "cfg-mcp4728",
|
|
131
131
|
"channel": "C",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
"id": "mcp4728-D",
|
|
143
|
-
"type": "
|
|
143
|
+
"type": "mcp4728",
|
|
144
144
|
"name": "MCP4728 D",
|
|
145
145
|
"device": "cfg-mcp4728",
|
|
146
146
|
"channel": "D",
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
"id": "mcp4728-all",
|
|
158
|
-
"type": "
|
|
158
|
+
"type": "mcp4728",
|
|
159
159
|
"name": "MCP4728 All",
|
|
160
160
|
"device": "cfg-mcp4728",
|
|
161
161
|
"channel": "A",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "tab",
|
|
5
5
|
"label": "PCF8591 ADC + DAC Demo",
|
|
6
6
|
"disabled": false,
|
|
7
|
-
"info": "An Inject node fires every second, triggering the
|
|
7
|
+
"info": "An Inject node fires every second, triggering the pcf8591 node to read all four analog channels. A Function node maps the four raw 0–255 values to approximate voltages (assuming 3.3 V reference). A Debug node prints the four channel voltages. A second Inject node sends a numeric payload to write a value to the on-chip DAC. The flow shows simultaneous ADC reading and DAC output from a single PCF8591 device."
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"id": "inj-read",
|
|
@@ -20,19 +20,33 @@
|
|
|
20
20
|
"z": "tab-pcf8591-demo",
|
|
21
21
|
"x": 140,
|
|
22
22
|
"y": 100,
|
|
23
|
-
"wires": [
|
|
23
|
+
"wires": [
|
|
24
|
+
[
|
|
25
|
+
"pcf8591-node"
|
|
26
|
+
]
|
|
27
|
+
]
|
|
24
28
|
},
|
|
25
29
|
{
|
|
26
|
-
"id": "pcf8591-
|
|
27
|
-
"type": "
|
|
30
|
+
"id": "pcf8591-device-1",
|
|
31
|
+
"type": "pcf8591-device",
|
|
28
32
|
"name": "PCF8591",
|
|
29
|
-
"bus": "1",
|
|
30
33
|
"address": "48",
|
|
34
|
+
"bus": "1"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "pcf8591-node",
|
|
38
|
+
"type": "pcf8591",
|
|
39
|
+
"name": "PCF8591",
|
|
31
40
|
"inputMode": "4 single-ended",
|
|
32
41
|
"z": "tab-pcf8591-demo",
|
|
33
42
|
"x": 360,
|
|
34
43
|
"y": 100,
|
|
35
|
-
"wires": [
|
|
44
|
+
"wires": [
|
|
45
|
+
[
|
|
46
|
+
"fn-volts"
|
|
47
|
+
]
|
|
48
|
+
],
|
|
49
|
+
"device": "pcf8591-device-1"
|
|
36
50
|
},
|
|
37
51
|
{
|
|
38
52
|
"id": "fn-volts",
|
|
@@ -44,7 +58,11 @@
|
|
|
44
58
|
"z": "tab-pcf8591-demo",
|
|
45
59
|
"x": 560,
|
|
46
60
|
"y": 100,
|
|
47
|
-
"wires": [
|
|
61
|
+
"wires": [
|
|
62
|
+
[
|
|
63
|
+
"dbg-voltages"
|
|
64
|
+
]
|
|
65
|
+
]
|
|
48
66
|
},
|
|
49
67
|
{
|
|
50
68
|
"id": "dbg-voltages",
|
|
@@ -77,6 +95,10 @@
|
|
|
77
95
|
"z": "tab-pcf8591-demo",
|
|
78
96
|
"x": 140,
|
|
79
97
|
"y": 200,
|
|
80
|
-
"wires": [
|
|
98
|
+
"wires": [
|
|
99
|
+
[
|
|
100
|
+
"pcf8591-node"
|
|
101
|
+
]
|
|
102
|
+
]
|
|
81
103
|
}
|
|
82
104
|
]
|
package/nodes/ad5243/ad5243.html
CHANGED
|
@@ -1,13 +1,52 @@
|
|
|
1
|
+
<!-- Config node: one instance per physical device -->
|
|
1
2
|
<script type="text/javascript">
|
|
2
|
-
RED.nodes.registerType('
|
|
3
|
-
category:
|
|
4
|
-
color: '#C084FC',
|
|
3
|
+
RED.nodes.registerType('ad5243-device', {
|
|
4
|
+
category: 'config',
|
|
5
5
|
defaults: {
|
|
6
6
|
name: { value: '' },
|
|
7
7
|
bus: { value: '1', required: true, validate: RED.validators.number() },
|
|
8
8
|
rab: { value: '10000', required: true },
|
|
9
9
|
rwiper: { value: '160', required: true, validate: RED.validators.number() }
|
|
10
10
|
},
|
|
11
|
+
label: function() {
|
|
12
|
+
return this.name || 'AD5243';
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script type="text/html" data-template-name="ad5243-device">
|
|
18
|
+
<div class="form-row">
|
|
19
|
+
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
20
|
+
<input type="text" id="node-config-input-name" placeholder="AD5243">
|
|
21
|
+
</div>
|
|
22
|
+
<div class="form-row">
|
|
23
|
+
<label for="node-config-input-bus"><i class="fa fa-microchip"></i> I²C bus</label>
|
|
24
|
+
<input type="number" id="node-config-input-bus" min="0" style="width:80px"> (Linux /dev/i2c-N)
|
|
25
|
+
</div>
|
|
26
|
+
<div class="form-row">
|
|
27
|
+
<label for="node-config-input-rab"><i class="fa fa-sliders"></i> RAB</label>
|
|
28
|
+
<select id="node-config-input-rab" style="width:120px">
|
|
29
|
+
<option value="2500">2.5 kΩ</option>
|
|
30
|
+
<option value="10000">10 kΩ</option>
|
|
31
|
+
<option value="50000">50 kΩ</option>
|
|
32
|
+
<option value="100000">100 kΩ</option>
|
|
33
|
+
</select>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="form-row">
|
|
36
|
+
<label for="node-config-input-rwiper"><i class="fa fa-sliders"></i> Wiper RW</label>
|
|
37
|
+
<input type="number" id="node-config-input-rwiper" min="0" style="width:80px"> Ω (typ. 160 Ω)
|
|
38
|
+
</div>
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<!-- Read node -->
|
|
42
|
+
<script type="text/javascript">
|
|
43
|
+
RED.nodes.registerType('ad5243', {
|
|
44
|
+
category: 'Peripheral',
|
|
45
|
+
color: '#C084FC',
|
|
46
|
+
defaults: {
|
|
47
|
+
name: { value: '' },
|
|
48
|
+
device: { value: '', type: 'ad5243-device', required: true }
|
|
49
|
+
},
|
|
11
50
|
inputs: 1,
|
|
12
51
|
outputs: 1,
|
|
13
52
|
icon: 'font-awesome/fa-sliders',
|
|
@@ -16,35 +55,22 @@
|
|
|
16
55
|
});
|
|
17
56
|
</script>
|
|
18
57
|
|
|
19
|
-
<script type="text/html" data-template-name="
|
|
58
|
+
<script type="text/html" data-template-name="ad5243">
|
|
20
59
|
<div class="form-row">
|
|
21
60
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
22
61
|
<input type="text" id="node-input-name" placeholder="AD5243">
|
|
23
62
|
</div>
|
|
24
63
|
<div class="form-row">
|
|
25
|
-
<label for="node-input-
|
|
26
|
-
<input type="
|
|
64
|
+
<label for="node-input-device"><i class="fa fa-microchip"></i> Device</label>
|
|
65
|
+
<input type="text" id="node-input-device">
|
|
27
66
|
</div>
|
|
28
67
|
<div class="form-row">
|
|
29
68
|
<label><i class="fa fa-at"></i> I²C address</label>
|
|
30
69
|
<span>0x2F (fixed, no address pins)</span>
|
|
31
70
|
</div>
|
|
32
|
-
<div class="form-row">
|
|
33
|
-
<label for="node-input-rab"><i class="fa fa-sliders"></i> RAB</label>
|
|
34
|
-
<select id="node-input-rab" style="width:120px">
|
|
35
|
-
<option value="2500">2.5 kΩ</option>
|
|
36
|
-
<option value="10000">10 kΩ</option>
|
|
37
|
-
<option value="50000">50 kΩ</option>
|
|
38
|
-
<option value="100000">100 kΩ</option>
|
|
39
|
-
</select>
|
|
40
|
-
</div>
|
|
41
|
-
<div class="form-row">
|
|
42
|
-
<label for="node-input-rwiper"><i class="fa fa-sliders"></i> Wiper RW</label>
|
|
43
|
-
<input type="number" id="node-input-rwiper" min="0" style="width:80px"> Ω (typ. 160 Ω)
|
|
44
|
-
</div>
|
|
45
71
|
</script>
|
|
46
72
|
|
|
47
|
-
<script type="text/html" data-help-name="
|
|
73
|
+
<script type="text/html" data-help-name="ad5243">
|
|
48
74
|
<p>Sets and reads the two 256-position wipers of an AD5243 dual I²C digital potentiometer. Wiper values are volatile: both channels power up at midscale (128).</p>
|
|
49
75
|
|
|
50
76
|
<h3>Inputs</h3>
|