Code for LCD I2C display only works when compiled by another computer than mine

Hi,

A friend and I have been developping a project that uses a 16*2 LCD display with I2C adapter board. His code, when compiled on my card (some electronics + a Pi Pico) with my computers (laptop and desktop, both running windows 10 and Arduino IDE 1.8.19 or 2.0) doesn't work. When the same code is uploaded on the same board with his computer, it works fine.

He's given me his library folder, his code, we've checked that we use the same card package ("Arduino MBED OS RP2040 Boards"), and yet it doesn't work on my computers.

The library he's using is John Rickman's LiquidCrystal_I2C. I've tried this one as well as many MANY others (including hd44780) and none work. HD44780 library allowed me to find the error code returned which is 'can't find device or address'.

I'm really out of ideas. The issue is not from my electronics or the code, they both work as we verified it when my friend compiled everything on my board.

Maybe my Arduino IDE install has an issue (already tried uninstalling several times, removing all Arduino related files from user/documents and Appdata).

arduino_debug.exe is stuck on "starting" and doesn't seem to do anything.

If anyone has an idea.. that would mean a lot. I'm starting to feel real bad not being able to complete such a big project (temperature controlled soldering iron).. I want to write my own code and not have to rely on my friend's code. Thank you in advance

Hi,

My first thought is to compile and download the example Blink without Delay program. This will verify (or not) that you computer can compile and download an executable program.

Take the library that works and put the appropriate files (.h, .cpp, etc) in the folder with your sketch. then change the <> on the include statement to "" and try. If it works you were loading the wrong library even though you had added the correct' onw.

Example How to fully encapsulate all libraries into sketch folder.
I am looking for a sketch - Using Arduino / Displays - Arduino Forum

@JohnRob other pieces of the code work just fine, it'sonly the LCD part that doesn't (more precisely, the I2C communication I suppose). I've uploaded codes without LCD usage and they work fine

@gilshultz I tried that, but that didn't change anything. i still have the same row of blocks on the LCD indicating that it didn't initialize.

Post a schematic of how you have it wired, not a frizzy thing. Also show all power and ground connections as well as links to technical info for each of the hardware items.

Are you saying you cannot communicate to the LCD from a program compiled on your computer? Have you tried the example in the LCD library you are using?

If so, I would do the following:
Go to where your Arduino sketches are. There is a folder named "library" I would rename it xxxLibrary. Then zip the contents and delete all the files (keeping the Zip file).

Now reinstall the library you are using for the LCD. Try the example and see if it works.

else

Assumption: its a software thing, not hardware.

Tell the IDE to generate compile messages. Compare these between the two computers. You should be able to see the differences in resources used to create the uploadable code.

@gilshultz it is not a hardware issue, the hardware works, it has been tested, everything works with a code compiled from another computer. If I had the slightest doubt about the hardware, I would have included a schematic. But there is no doubt possible about the hardware. The only 2 things that changed between the upload that works and the one that doesn't are the computer used to compile and the USB cable linking the Pico to the computer.

@JohnRob I've tried that already, many times, I'll gladly do it again.. But as I said, I've tried it already without any luck. I agree, it is a software issue. But it is not an issue from my code, it's either the library (I've tested everything I could regarding the library) or the Arduino IDE (I have no idea what could be wrongly setup in the IDE).

I'll try to get the compile messages, but from memory, I don't think they were different.

Did you try my first suggestion and run it on both machines?

I'm not sure about you but the messages I see fly by so fast I can only catch snippets as they zoom by.

Below is a snapshot of what I am referring to. Every library and every path is identified. If there is a difference then you will see it. If there is no difference then you will have a list of components that you can delete from your computer and re-install.

If you have a Windows machine then the path to much of the Arduino resources is normally hidden. For me the path is :

C:\Users\John\AppData\Local\Arduino15

If I had your problem and no success to date I would:

  • Uninstall Arduino IDE
  • Backup then delete the Arduino sketch directory (this will include the libraries)
  • Delete the Arduino15 folder. This is an important step.

Reinstall what you need.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.