#  how i use "node-red-contrib-i2c 0.5.2"

**URL:** https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393
**Category:** General
**Created:** [25 May 2018 18:19 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393 "2018-05-25T18:19:04Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)
#### Post date: [25 May 2018 18:19 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393/1 "2018-05-25T18:19:04Z")

</div>

can anyone tell me (show example) of how i use “node-red-contrib-i2c 0.5.2” or point me in the right direction as i am complete lost with it so far

i can see address 40 & 70 but beyond that not sure what to do

i have a servo board that uses it pca9685

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [25 May 2018 20:03 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393/2 "2018-05-25T20:03:53Z")

</div>

Hi  
I installed that node and then thought same as you - how on earth do we use it!

But I’ve been a bit lucky and managed to get it to send and receive some info from an i2C board (its a PiRoCon robot controller board that has an Arduino wired to the Pi via I2C which has a lot of info on the i2c commands)

So I found out the board had an address of 34 using the scan node

And then by looking at exisiting software for the board, I found out that to set up an input I had to send a command byte (14) and then action byte (1) to set port 0 on it to analogue input

Then I found out to read the analagoue value - I needed to send command byte(1) and then wait for 2 bytes (representing low and high bytes of a 0 - 1024 value) to be received

Have a look at my flows and see if you can work out how to do something with your board with similar commands

`[{"id":"a52d7898.c71278","type":"i2c out","z":"6e77bbbe.8836c4","name":"","address":"34","command":"14","payload":"1","payloadType":"num","count":"1","x":535,"y":245,"wires":[]},{"id":"e333b0f6.342f","type":"inject","z":"6e77bbbe.8836c4","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":284,"y":246,"wires":[["a52d7898.c71278"]]},{"id":"95998b69.b57e78","type":"i2c in","z":"6e77bbbe.8836c4","name":"","address":"34","command":"1","count":"2","x":518,"y":112,"wires":[["fa329f91.24f76"]]},{"id":"fa329f91.24f76","type":"debug","z":"6e77bbbe.8836c4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":750,"y":114,"wires":[]},{"id":"d623f42a.5ce708","type":"inject","z":"6e77bbbe.8836c4","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":286,"y":112,"wires":[["95998b69.b57e78"]]}]`

Simon

---

<div class="post-metadata">

### Author: ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)
#### Post date: [25 May 2018 22:14 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393/3 "2018-05-25T22:14:47Z")

</div>

Thanks that helps a little I will have a play.  
I have also found this “node-red-contrib-pca9685” which is the board I have which might help but it keeps telling me pwm is undefined but I don’t know why

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [25 May 2018 22:29 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393/4 "2018-05-25T22:29:54Z")

</div>

The readme looks fairly comprehensive, so if its not working I’d try dropping the author a note

---

<div class="post-metadata">

### Author: ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)
#### Post date: [25 May 2018 23:37 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393/5 "2018-05-25T23:37:11Z")

</div>

ok sorry i know i am a bit thick but how do i know who the author is and where is the readme?

---

<div class="post-metadata">

### Author: ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)
#### Post date: [25 May 2018 23:53 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393/6 "2018-05-25T23:53:33Z")

</div>

i dont see how to contact people (how do you drop the author a note)

---

<div class="post-metadata">

### Author: ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)
#### Post date: [26 May 2018 08:37 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393/7 "2018-05-26T08:37:52Z")

</div>

Go to [https://flows.nodered.org/](https://flows.nodered.org/) and search for the node. There is usually a link on the node page to GitHub. In this case [https://github.com/kelly/node-i2c](https://github.com/kelly/node-i2c)

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [26 May 2018 08:43 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393/8 "2018-05-26T08:43:38Z")

</div>

> [@ghayne](#):
>
> There is usually a link on the node page to GitHub. In this case [GitHub - kelly/node-i2c: Node.js native bindings for i2c-dev. Plays well with Raspberry Pi and Beaglebone.](https://github.com/kelly/node-i2c)

That is a link to the module the i2c node uses. The node itself is here [GitHub - nielsnl68/node-red-contrib-i2c: This set of node-red nodes communicate with the Raspberry Pi I2C driver and uses the I2C-bus package.](https://github.com/nielsnl68/node-red-contrib-i2c)

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [26 May 2018 09:01 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393/9 "2018-05-26T09:01:45Z")

</div>

I think the conversation has moved on from node-red-contrib-i2c to using node-red-contrib-pca9685 instead

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [26 May 2018 09:15 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393/10 "2018-05-26T09:15:42Z")

</div>

Ok...

> **[node-red-contrib-pca9685](https://flows.nodered.org/node/node-red-contrib-pca9685)**
>
> Control a PCA9685 board with Node-RED

> **[fauberso/node-red-contrib-pca9685](https://github.com/fauberso/node-red-contrib-pca9685)**
>
> Node-RED node for the NXP PCA9685 PWM Controller. Contribute to fauberso/node-red-contrib-pca9685 development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)
#### Post date: [26 May 2018 09:20 UTC](https://discourse.nodered.org/t/how-i-use-node-red-contrib-i2c-0-5-2/393/11 "2018-05-26T09:20:11Z")

</div>

Oops I should not post before breakfast!
