-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPCA9685.html
60 lines (56 loc) · 2.38 KB
/
PCA9685.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<script type="text/javascript">
RED.comms.subscribe('ncd-dependencies', (t,d) => {
RED.notify(d);
})
RED.nodes.registerType('ncd-pca9685',{
category: 'NCD',
color: '#a6bbcf',
defaults: {
name: {value: ""},
connection: {value: "", type: "ncd-comm"},
address: {value: 64, validate: RED.validators.number()}, //0x69 = 105
frequency: {value: 55, validate: RED.validators.number()}, //Value in Hz
channels: {value: 8, validate: RED.validators.number()} //Count of Channels connected to PCA9685
},
inputs:1,
outputs:1,
icon: "serial.png",
paletteLabel: "PCA9685",
label: function() {
return this.name || "PCA9685";
},
outputLabels: ['PWM Status'],
});
</script>
<script type="text/x-red" data-template-name="ncd-pca9685">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-connection"><i class="icon-tag"></i> I2C Connection</label>
<select id="node-input-connection"></select>
</div>
<div class="form-row">
<label for="node-input-address"><i class="icon-repeat"></i> I2C Address</label>
<input type="number" id="node-input-address" placeholder="Address">
</div>
<div class="form-row">
<label for="node-input-frequency"><i class="icon-repeat"></i> Frequency</label>
<input type="number" id="node-input-frequency" placeholder="Frequency">
</div>
<div class="form-row">
<label for="node-input-channels"><i class="icon-repeat"></i> Channel Count</label>
<input type="number" id="node-input-channels" min=1 max=16 placeholder="Channel Count">
</div>
</script>
<script type="text/x-red" data-help-name="ncd-pca9685">
<h3>I2C Connection</h3>
<p>Configure the connection you want to use to communicate to your I2C device. Native I2C and USB to I2C converters are supported.</p>
<h3>Interval</h3>
<p>The interval defines the time between status checks. It is in milliseconds, and the interval starts after the previous check has finished.</p>
<h3>Chip Selection</h3>
<p>The range and type of the chip are part of the part number, e.g. "PCA9685-0003-D-B" has a range of "0003" and a type of "D-B"</p>
<h3>Output Values</h3>
<p>The output will send an object as the payload keyed by the value, <code>{temperature: 77.234, pressure: 1.54356}</code>.</p>
</script>