1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00
node-red-nodes/hardware/PiLiter
Sam Machin 2d28a2304f
Update package.jsons for mono-repo (#851)
Update the package.json for each node to point to the directory within the repo that hosts the code for the package in question.  as per https://docs.npmjs.com/cli/v7/configuring-npm/package-json#repository
2021-11-02 15:22:30 +00:00
..
39-rpi-piliter.html Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
39-rpi-piliter.js fixup pilter and pisrf for python2/3 2021-06-18 08:56:15 +01:00
LICENSE Update licenses and packages for all nodes 2016-11-06 20:26:19 +00:00
nrgpio add python 3 tests to most shell scripts 2021-05-09 17:42:26 +01:00
nrgpio.py Define raw_input() in Python 3 (#473) 2018-08-12 18:58:11 +01:00
package.json Update package.jsons for mono-repo (#851) 2021-11-02 15:22:30 +00:00
README.md update hardware nodes info style 2016-03-02 13:27:52 +00:00

node-red-node-piliter

A Node-RED node to control a Pimorini Pi-LITEr 8 LED add-on board for a Raspberry-Pi.

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

npm install node-red-node-piliter

Pre-reqs

Requires the python RPi.GPIO library v0.58 (or better) to be installed in order to work. See the RPi.GPIO site for details on how to do this.

This is built into most recent Raspbian versions so no install should be necessary - but if necessary

$ sudo apt-get update
$ sudo apt-get install python-rpi.gpio python3-rpi.gpio

Usage

Raspberry Pi-LITEr output node. The Pi-LITEr must be fitted.

Operates in one of 5 different modes :

  • Byte Mode - expects a value between 0 and 255, and each of the LEDs represent 1 bit.
  • Meter Mode - expects a value between 0 and 8, the led lit corresponds to the input value - like a meter needle.
  • Bar Mode - expects a value between 0 and 8, similar to meter - but all the leds up to the value are turned on - like a mini bar chart.
  • All LEDs Mode - expects a 1 or 0 - turns on and off ALL the LEDs
  • Object Mode - expects a object specifying the LED and state eg. {led:3,state:0} to set LED3 off.

Requires the RPi.GPIO library installed in order to work.

In order to access the GPIO the nrgpio.py command (installed as part of this package) must be run as root (sudo). The default Pi user can do this so it "should just work" - however if you are running Node-RED as not the Pi user then you may need to give your user sudo rights - or specifically sudo rights to python.