Correct Library to use with Adafruit RGB LCD Shield and Photon

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?

@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. :slight_smile:

1 Like

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

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

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.

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

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.