-
Notifications
You must be signed in to change notification settings - Fork 5
/
ina.html
104 lines (90 loc) · 2.82 KB
/
ina.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<script type="text/javascript">
RED.nodes.registerType('ina-sensor-manager',
{
category: 'config',
defaults:
{
name: {value:""},
address: {value: 0x40, required: true},
delay: {value: 250, required: true},
ohms: {value:0.01},
customResistor: {value:false},
},
oneditprepare: function ()
{
},
icon: "arrow-in.png",
label: "ina Manager",
});
</script>
<script type="text/x-red" data-template-name="ina-sensor-manager">
<div class="form-row">
<label for="node-config-input-address"><i class= "icon-bookmark"></i>Address of ina</label>
<select id= "node-config-input-address">
<option value=0x40> 0x40 </option>
<option value=0x41> 0x41 </option>
<option value=0x44> 0x44 </option>
<option value=0x45> 0x45 </option>
</select>
</div>
<div class="form-row">
<label for="node-config-input-delay"><i class= "icon-bookmkark"></i>Delay between samples in ms</label>
<input type="number" id="node-config-input-delay" min="5" placeholder="250 milliseconds"/>
</div>
<div class='form-row'>
<label for="node-config-input-customResistor"><i class='fa fa-tag'></i>Use Customm Resistor?</label>
<input type='checkbox' id='node-config-input-customResistor' style='width: auto;'/>
</div>
<div class='form-row' <div class='form-row'>
<label for='node-config-input-ohms'><i class='fa fa-tag'></i> ohms </label>
<input type='number' id="node-config-input-ohms" min='0' step="any" placeholder='0.01' />
</div>
</script>
<script type="text/x-red" data-template-name="ina-sensor-manager">
<p>
<b> Polls sensor data and sends it to all the output nodes </b><br>
</p>
</script>
<script type="text/x-red" data-help-name="ina-sensor-manager">
<p>
Polls a ina-219 on i2c dev 1<br>
<a href="https://www.ti.com/lit/ds/symlink/ina219.pdf"> ina-210 </a> can be wired for four different addresses which can be chosen from the dropdown <br>
Sample rate can also be adjusted <br>
Calibrated for 32v 1amp <br>
</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('ina-sensor',
{
category: 'Sensor',
color: '#D7A1D1',
defaults:
{
name: {value:""},
handle: {type: 'ina-sensor-manager', required: true},
},
inputs: 1,
outputs: 2,
icon: 'arrow-in.png',
label: function()
{
return this.name || "INA219 V/A"
},
});
</script>
<script type="text/x-red" data-template-name="ina-sensor">
<div class = "form-row">
<label for="node-config-input-name"><i class="icon-tag"></i> Name </label>
</div>
<div class = "form-row">
<label for="node-config-input-handle"><i class= 'fa fa-tag'></i> Handle </label>
<input type = 'text' id='node-input-handle' />
</div>
</script>
<script type="text/x-red" data-help-name="ina-sensor">
<p>
Top output is voltage <br>
Bottom output is milliamps <br>
Calibrated for 32v 1amp <br>
</p>
</script>