UNPKG

node-red-contrib-libgpiod

Version:

A set of input and output nodes for controlling General Purpose Input and Outputs (GPIOs) though libgpiod (ioctl)

47 lines (44 loc) 1.74 kB
<script type="text/javascript"> RED.nodes.registerType('gpio-out', { category: 'libgpiod', defaults: { name: { value: '' }, state: { value: 'OUTPUT', required: true }, device: { value: 'gpiochip0', required: true }, pin: { value: '', required: false }, }, color: '#FCF37A', icon: 'font-awesome/fa-sign-in', inputs: 1, outputs: 1, align: 'right', paletteLabel: 'GPIO out', label() { return this.name || `gpio out #${this.pin || '?'}` }, }) </script> <script type="text/x-red" data-template-name="gpio-out"> <div class="form-row" id="node-div-deviceRow"> <label for="node-input-device"><i class="fa fa-circle"></i> Device</label> <input type="text" id="node-input-device" placeholder="gpiochip0"> </div> <div class="form-row"> <label for="node-input-state"><i class="fa fa-wrench"></i> Type</label> <select type="text" id="node-input-state" style="width: 200px;"> <option value="OUTPUT">Digital (0/1)</option> </select> </div> <div class="form-row" id="node-div-pinRow"> <label for="node-input-pin"><i class="fa fa-circle"></i> Pin</label> <input type="number" id="node-input-pin" placeholder="12"> </div> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-tips" id="node-div-formTipRow"><b>Note:</b> You can't use the same pin for both output and input.</div> </script> <script type="text/x-red" data-help-name="gpio-out"> <p>gpio output node. A node for sending data to General Purpose Input and Outputs (GPIOs) pins though libgpiod</p> </script>