2.0.7 • Published 7 months ago

@redplc/node-red-rpi-gpio v2.0.7

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
7 months ago

@redplc/node-red-rpi-gpio

platform platform platform

Node-RED nodes for Raspberry Pi GPIO using with redPlc nodes.

Nodes

  • rpi-gpio-in: Reads GPIO inputs and store in boolean array.
  • rpi-gpio-out: Sets GPIO outputs from boolean array.
  • rpi-gpio-pwm: Sets GPIO pwm duty cycles from number array.
  • rpi-gpio-cnt: Counts GPIO inputs pulse and store in number array.

Usage

  • Install redPlc nodes.
  • Use redPlc s-inject node for trigger update.
  • Connect to first output on s-inject node.
  • Daisy chain nodes in series.
  • For logical operations use redPlc nodes.
  • Data is exchanged with global context variable arrays.
  • Array index is equal gpio number for easy handling.
  • Select different gpio pins for input, output and pwm.
  • For open inputs select pull down/up resistors.
  • This node works on Raspberry Pi with 32bit or 64bit OS.
  • Check with raspi-config for alternate functions on GPIO.

Array Index Mapping

IndexFunct.PinPinFunct.Index
3V3125V
2GPIO02345V
3GPIO0356GND
4GPIO0478GPIO1414
GND910GPIO1515
17GPIO171112GPIO1818
27GPIO271314GND
22GPIO221516GPIO2323
3V31718GPIO2424
10GPIO101920GND
9GPIO092122GPIO2525
11GPIO112324GPIO088
GND2526GPIO077
2728
5GPIO052930GND
6GPIO063132GPIO1212
13GPIO133334GND
19GPIO193536GPIO1615
26GPIO263738GPIO2020
GND3940GPIO2121

Examples

Example 1

This example is a self holding circuit used for push buttons. Led turns on, if switch GPIO21 is closed. Led turns off, if switch GPIO20 is closed.

  • Connect LED with resistor (~220 Ohms) to GPIO26 and ground pin.
  • Connect switches to GPIO20 and GPIO21 and ground pin.
  • Select GPIO20 and GPIO21 as pullup inputs.
  • Select GPIO26 as output.

Example 2

This example sets led brightness to 25%, 50% or 100% with switches.

  • Connect LED with resistor (~220 Ohms) to GPIO26 and ground pin.
  • Connect switches to GPIO16, GPIO20 and GPIO21 and ground pin.
  • Select GPIO16, GPIO20 and GPIO21 as pullup inputs.
  • Select GPIO26 as pwm.
2.0.7

7 months ago

2.0.6

8 months ago

2.0.5

8 months ago

2.0.4

9 months ago

2.0.3

9 months ago

2.0.2

9 months ago

2.0.1

9 months ago

2.0.0

9 months ago