# Correct Library to use with Adafruit RGB LCD Shield and Photon

**URL:** <https://community.particle.io/t/correct-library-to-use-with-adafruit-rgb-lcd-shield-and-photon/34368>\
**Category:** Libraries\
**Created:** [July 6, 2017, 5:39pm UTC](https://community.particle.io/t/correct-library-to-use-with-adafruit-rgb-lcd-shield-and-photon/34368 "2017-07-06T17:39:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ovro67](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@ovro67](https://community.particle.io/u/ovro67)\
**Post date:** [July 6, 2017, 5:39pm UTC](https://community.particle.io/t/correct-library-to-use-with-adafruit-rgb-lcd-shield-and-photon/34368/1 "2017-07-06T17:39:48Z")

</div>

Can the Adafruit p.n. 714 RGB LCD I2C Display be used connected: SDA to I2C data pin (D0 on Photon/Electron) and SCL to I2C clock pin (D1 on Photon/Electron), which is the correct Library to choose when using the Web IDE, ADAFRUIT\_RGBLCDSHIELD or the ADAFRUIT\_LIQUIDCRYSTAL Library? The HelloWorld.cpp example listed in the Adafruit RGBLCDSHIELD Library has these comments,  
// The shield uses the I2C SCL and SDA pins. On classic Arduinos  
// this is Analog 4 and 5 so you can’t use those for analogRead() anymore  
// However, you can connect other I2C sensors to the I2C bus and share  
// the I2C bus.  
If connected using the standard Particle I2C pins, (D0 & D1) will the display work?

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [July 6, 2017, 5:47pm UTC](https://community.particle.io/t/correct-library-to-use-with-adafruit-rgb-lcd-shield-and-photon/34368/2 "2017-07-06T17:47:32Z")

</div>

@ovro67, the correct library is the ADAFRUIT\_RGBLCDSHIELD one and yes, connecting the I2C lines though it’s unclear whether you need pull-up resistors or not. Try without to begin with. Make sure to power the display from the Vin pin of the Photon and not from 3V3. 🙂

---

<div class="post-metadata">

**Author:** ![ovro67](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@ovro67](https://community.particle.io/u/ovro67)\
**Post date:** [July 7, 2017, 5:07pm UTC](https://community.particle.io/t/correct-library-to-use-with-adafruit-rgb-lcd-shield-and-photon/34368/3 "2017-07-07T17:07:26Z")

</div>

Thank you so much. Just ordered 714 from Adafruit and Particle Shield Shield.

Do you know which file was edited from Arduino A4,A5 (I2c) to using D0, D1 for Particle? I looked in ADAFRUIT\_RGBLCDSHIELD.cpp and ADAFRUIT\_RGBLCDSHIELD.h but couldn’t find it. There are other files included in these files like application.h but I don’t know how to locate it. I read that wire.h describes I2C code.  
Thanks again

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [July 7, 2017, 6:22pm UTC](https://community.particle.io/t/correct-library-to-use-with-adafruit-rgb-lcd-shield-and-photon/34368/4 "2017-07-07T18:22:43Z")

</div>

@ovro67, the pins are defined ADAFRUIT\_RGBLCDSHIELD.cpp using numerical pin numbers instead of equivalent Particle pin designation. It should work as is.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [July 7, 2017, 7:50pm UTC](https://community.particle.io/t/correct-library-to-use-with-adafruit-rgb-lcd-shield-and-photon/34368/5 "2017-07-07T19:50:39Z")

</div>

> [@ovro67](#):
>
> Do you know which file was edited from Arduino A4,A5 (I2c) to using D0, D1 for Particle?

I haven't checked the lib, but generally you wouldn't need to change any pin designators since the `Wire` object already is tied to the correct pins. Just wire it up correctly and you should be good.

---

<div class="post-metadata">

**Author:** ![ovro67](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@ovro67](https://community.particle.io/u/ovro67)\
**Post date:** [July 7, 2017, 8:32pm UTC](https://community.particle.io/t/correct-library-to-use-with-adafruit-rgb-lcd-shield-and-photon/34368/6 "2017-07-07T20:32:00Z")

</div>

I didn’t want to change anything but wanted to see if I could verify that the Library I was using had been modified to work on Particle. I thought I would eventually see a, int SCL = D1 and then a pinMode(SCL,OUTPUT) line of code somewhere. When you look at the Adafruit RGB LCD Description it mentions only working with Arduino’s, there’s no mention of using with Particle, an no Particle example. I’m pretty new at this.  
I’ve been using an Adafruit\_Si7021 library and the 7021 example doesn’t have a include wire.h linear all. I guess its buried deep in one of the library files.  
Thanks

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [July 7, 2017, 8:38pm UTC](https://community.particle.io/t/correct-library-to-use-with-adafruit-rgb-lcd-shield-and-photon/34368/7 "2017-07-07T20:38:35Z")

</div>

A missing `#include "wire.h"` but the actual use of the `Wire` object used to be an evidence for a Particle port, but that’s for a while no, you may see these lines in a code and it’ll still run on Particle devices.  
That’s the beauty of hardware agnosticism/abstraction when the same code can run on a different platform without needing to care about HW differences.

The pin numbers you see in the library refer to the MCP23017 and have nothing to do with the Particle GPIOs Ax or Dx.
