Trouble getting LiquidCrystal_I2C_Spark library to work

Is it just me? I try to verify the example in that library and it fails. The IDE doesn’t seem to be able to get past the initial ‘include’ statement. Won’t verify, much less upload to a Photon.
I am trying to hook up a 2x16 LCD display using an I2C adapter. I confirmed that the display is good with an Arduino; but I can’t get the Particle library to compile when targeting a Photon. Is the library good for ‘Core’ only???

yeah, I didn't recieve my Photons yet so haven't had to look at that library.

Maybe someone can look at it, like @ScruffR ;), and update it for the Photon.

otherwise, I can get to it once I get my Photons :slight_smile: should be next weekend.

fyi, you will see a similar issue buried in this diatribe:

1 Like

Bulldog - I just want to say thank you for looking into this issue. I wish I knew enough to participate more myself!

There were several threads that commented on CLOCK_SPEED_xxx being missing on the Photon and the general answer is

As a temporary work around (till the new firmware 0.4.2 gets pushed for cloud build) try adding

#ifdef PLATFORM_ID
#include "i2c_hal.h"
#endif

e.g. I2C Clock speed change on Photon

I tried adding the code suggested to the example provided n the library… no luck. The error is still:

LiquidCrystal_I2C_Spark/LiquidCrystal_I2C_Spark.cpp:48:23: error: ‘CLOCK_SPEED_100KHZ’ was not declared in this scope
Wire.setSpeed(CLOCK_SPEED_100KHZ);

I’m assuming that the change has to be done in the user code, not the library itself. I tried adding it to the top of the library but (as I expected) I can’t edit that file.

I forked the @BulldogLowell code to https://github.com/mumblepins/LiquidCrystal_I2C_Spark here and applied the @ScruffR suggested fix. It sounds like this isn’t going to be an issue once the new firmware comes out, so I’m not sure that @BulldogLowell would want to pull this change into his version of the library, but until then, you can always import a private library into the web IDE. Just go to libraries, contribute library, type in mumblepins/LiquidCrystal_I2C_Spark, hit enter, it should validate, and then you can hit import. Then you can use that library until the next firmware comes out.

1 Like

Thank you, I will give it a try.
I agree that if the issue is not @BulldogLowell 's fault, he shouldn’t change anything in his library and we shoul just wait for the proper fix.

FWIW, calling the Core or Photon ‘Arduino compatible’ is just silly… if you try to hook up ANYTHING besides a switch and LED, it’s broke, and us mere mortals depend on the kindness of good Samaritans like you to help us out. Thanks.

I also wanted to check if the delays were necessary on the Photon vs. the library that was previously posted. I’m curious to see if the I2C timing issues that Core struggled with are also a problem on Photon.

@BulldogLowell, I’d love to test out the timing on the Photon - the thing is, I have got Photons but no I2C displays hanging round :weary:

2 Likes

See GitHub Issue https://github.com/BulldogLowell/LiquidCrystal_I2C_Spark/issues/2
Any update so far?

I gave up on I2C displays on the Photon, and used a cheap SPI display instead. Easy and it worked out for the better.

(This is a display retrieving measurements from Thingspeak, as posted by a separate Photon sending data from outside the house. Yes, it really is that hot right now.)

1 Like

apparently a dry heat, though! Nice display

I've been traveling but can likely get this sorted for the std I2C displays later in the month.

Seems to compile with firmware 0.4.4