I2C/LCD Hello World needed

Hi all. I’m starting my first real Spark project and would like to add an LCD for feedback. The LCD I’m using came with an Arduino kit I bought and the backpack is a Serial IIC I2C Adapter Serial Interface Board Module For Arduino, Model: GY-IIC-LCD.

I’ve read the existing I2C/LCD posts (very informative) and tried all the code. Some of it sorta worked, some not at all (no fault of the authors I’m sure). By sorta, I mean I can get the backlight to work but it doesn’t write anything to the screen.

Does anyone have a bare-bones “Hello World” sample code I can use as a starting point? I would like to start simple and build on whatever success I can achieve. BTW, I am a novice programmer so simpler is better. :smiley:
Thanks,
Bruster

@Bruster, you now have 3 topics regarding this display. Can I ask you to kindly keep it to one so we don’t have to repeat our answers :stuck_out_tongue:

I have the impression that something is not setup correctly with either the hardware or the code. On THIS topic, can you post the code your are attempting to use?

1 Like

Hi all,
I just got my new Spark and I’m trying to get it to work with my 1602 LCD with backpack. Unfortunately I can’t even get to 1st base (no backlight). The LCD came with the Arduino kit I bought and the backpack is a Serial IIC I2C Adapter Serial Interface Board Module For Arduino 1602 2004 LCD, Model: GY-IIC-LCD.

I know the LCD works as I tried it on an Arduino (twice) and have used it on other Arduino projects. I tried two different AC adapters as power sources as well as powering from USB. One of the power sources I used to test with the UNO. There is an LED on the backpack that lights up. I checked the voltage between VCC and GND and it’s 4.56v on the Spark and 4.78v on the Arduino.

Any thoughts or magic tricks to get the LCD to illuminate?
Bruster

@Bruster, first things first. You may need pull-up resistors (4.7K ohms) on the I2C lines if there are none on the backpack. Seconds, which library are you using? Third, I believe the backlight is turned on with software so that may explain that. :smile:

@peekay123, I’m using code from a project called “lcd-buses-±weather-report” and trimmed out everything but the backlight command for now. I’ll try the pull-ups and see if that helps. Thanks.

Dang. Didn’t work. I added the 4.7k pull-ups from the +5v rail to D0 and D1. Is there a simple I2C LCD test sketch floating around? Something akin to “Hello Sparky!”?

Bruster

Hi @Bruster

I can see that you don’t have any external pull-up resistors on the i2c lines. On Spark these always need a pull-up resistor (4.7k ohm is ideal) to 3.3V.

Have you tried adding pull-up resistors on both lines?

Hi @bko. I didn’t at first but I read others discussing the pull-ups and added them but it didn’t make any difference. I put the 4.7k resistors from the +5 rail to D1 and D1. The code loads into the Spark, the main LED breaths cyan but the display remains blank.

Thanks.

D0 -> SDA
D1 -> SCL
Vin -> +5 to rails
GND -> GND rails

@Bruster,

i have moved all the posts into this topic where the title better reflects what you need :smiley:

2 Likes

@Bruster:
I have made a “tutorial” for i2c LCD.
Maybe this could help you:

3 Likes

Thanks @kennethlimcp.

1 Like

New to the forum. Will do. My bad.

1 Like

@Bruster The display in your picture looks broken - you shouldn’t have that blacked out area in the centre of the LCD and certainly not that large smudge along where the bottom line of text should be. Have you exposed it to high temperatures or dropped it/had something resting on it?

Do you have a different LCD you can test this with?

Hey @NanoAkron. I appreciate the input but the LCD itself is ok. I’m using it right now on an Arduino project. :smile: I think what you are seeing is just the plastic film on the screen that protects the soft plastic display. I never remove that unless I have to.

However, I have ordered new 16x2 and 20x4 displays.

Ah :frowning:

Well, @peekay123 helped me to get the NewHaven C0220 BiZ 2x20 I2C display working, maybe try that one?

Have anyone ever tried to perform an analogRead() while using I2C/SPI???

My source compiles and uploads to the core but then the core hangs.
w/o it’s fine…

You might want to paste the code in a Gist and post the link here so that we can help take a look :wink: