npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-i2c

v0.9.0

Published

A Node-RED node to talk to the Raspiberry PI's I2C port

Downloads

596

Readme

node-red-contrib-i2c

This set of node-red nodes communicate with the Raspberry Pi I2C driver and uses the node-I2C package. Run the following command in the root directory of your Node-RED install, usually this is ~/.node-red.

This node now allows you configure the bus number of the i2c driver. For most Pi this is 1 for /dev/i2c-1, or 0 for /dev/i2c-0 for a older rev 1 Pi.

Install

Either use the Manage Palette option in the Node-RED Editor menu, or run the following command in your Node-RED user directory - typically ~/.node-red

npm install --unsafe-perm node-red-contrib-i2c

Usage

Provides three nodes - one to scan connected device, one to receive messages, and one to send.

Scan I2C

This will scan the I2C bus for connected devices. It has one input to trigger the scan process and 2 outputs:

  • The first output gives a list of all found devices in msg.payload and will be triggered once.
  • The second output will be triggered for every found device. The address will be in msg.payload

Input I2C

This node will request data from a given device. The address and command can both be set in the dialog screen or dynamically with msg.address and msg.command. This node outputs the result as a buffer in msg.payload and places the address in msg.address and command in msg.command.

Output I2C

This node will send a given String/array/buffer to a given device. The address and command can both be set in the dialog screen or dynamically with msg.address and msg.command. The payload can be set statically or dynamically (using msg.payload).

This payload can be a Buffer, Array, String or Integer. When you use integers the number of bytes to send is important and can be set between 0 and 31 bytes.

Since v0.5.0 - you can daisychain this node, the input msg is sent unchanged to the next node.

Important Note

This node is now using the I2C-bus package from @fivdi. It looks more robust and better for asyncrone processes like node-red. I would like to thank the maker for his work. You can vind his work on github: https://github.com/fivdi/i2c-bus

The pld set of nodes did use the work of Kelly's I2C package to work. And I would like to thank him for the work he did on that package. For more info check out his github account at: https://github.com/kelly/node-i2c