Giter Site home page Giter Site logo

rmascitti / node-contrib-i2c Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nielsnl68/node-red-contrib-i2c

0.0 1.0 0.0 31 KB

This set of node-red nodes communicate with the Raspberry Pi I2C driver and uses the node-I2C package.

License: GNU General Public License v3.0

HTML 60.53% JavaScript 39.47%

node-contrib-i2c's Introduction

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 .

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.

Configuration

When you start using on of the below nodes you need first to configurate the I2C Device. The Raspberry PI uses an special device name to connect to the I2C controller. Depending on the Raspberry PI version it can be one of the below values; for the RPi Rev 1 it /dev/i2c-0 and all Others it will be /dev/i2c-1 (=default). In the config screen you can also set the default I2C-address to where the node sends the Messages and request's to.

Scan I2C

This will scan the I2C bus for connected devices and has one in point to trigger the scan process and 2 out put points:

  • The first output point give a list of all found decives in msg.payload and will be triggered once.
  • The second output point 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 dynamicly 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 dynamicly with msg.address and msg.command. The payload can be staticly or dynamicly (using msg.payload) set. This payload can be a Buffer, Array, String or Integer. When you use integers then the number of bytes to send is importend and can be set between 0 and 6 bytes.

Inportend Note

This set of nodes is using the work of kelly's I2C package to work. And i like to thank hem for the work he did on that package. For more info check out his github account at: https://github.com/kelly/node-i2c

node-contrib-i2c's People

Contributors

nielsnl68 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.