UNPKG

node-red-contrib-easybotics-ina219-sensor

Version:
105 lines (90 loc) 2.89 kB
<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>