Help with temperamental I2C display...

I bought this display from ebay http://www.ebay.co.uk/itm/Arduino-IIC-I2C-TWI-1602-Serial-LCD-Module-Display-/190573003243?_trksid=p5197.m7&_trkparms=algo%3DLVI%26itu%3DUCI%26otn%3D4%26po%3DLVI%26ps%3D63%26clkid%3D6401143772000969980#ht_4295wt_922

I then had to butcher the library to get it working as the stock library wouldn't work.

http://www.mattinglis.com/upload/LiquidCrystal_I2C.cpp http://www.mattinglis.com/upload/LiquidCrystal_I2C.h

These are the files i came up with, but its a very temperamental display. It displays text right every second time, every first time i get the likes of @@£M and then nothing I can't write when i set the cursor to (0,0) And it seems to update very slow.

Can anyone help with what im doing wrong? Cmds to the screen work find, writting to it however is temperamental

How "not working" is the original library. Since different I2C LCDs use different boards and different libraries, you have to stick to the original library.

OK, I see, the original lib was not updated to arduino 1.0 and you tried to update it. Can I suggest you to use arduino 0022 and compile?

Yeah i modified the original library to work with arduino 1.0

I compiled the original library with the older arduino and it works but does the exact same thing.

It seems as if the screen isn't initialising half of the time, im gonna solder all the wires instead of using connectors to see if its loosing part of the transmision.

I have soldered all the connections and im now running the original library on arduino 23.

It still does the same thing, the display will only display properly every second time it is run, otherwise it just displays rubbish.

I can't help feeling there is something wrong with the initialisation of the the screen, but im way out my depth, im not very confident all the wiring is correct as the display works perfectly. It must be the configuration and init()

Can anyone help?

Have you contacted the seller for support yet? I don't know enough to help but the library author should.

It still does the same thing, the display will only display properly every second time it is run, otherwise it just displays rubbish.

Let's see your sketch so we can see the order in which things are happening (or not happening).

I doubt that the "author" of the library can help you any more that we can. All he did was hack up the standard LiquidCrystal library and he may very well have messed up some of the timing. Seeing your code might give us a clue about where to look.

Don

Ahaha the seller of the screen got back to me at last, it was shipped with the wrong library

heres the link to the right library if anyone else bought the screen. http://www.dfrobot.com/index.php?route=product/product&path=53&product_id=135

explains a lot, has a different clear screen code.

Sorted thanks for help anyway.

explains a lot, has a different clear screen code.

And this explains a lot to me as well and is the precise reason I asked to see your code. In your original post you said "I can't write when i set the cursor to (0,0)". You mentioned nothing about clearing the screen.

The instruction to clear the screen takes about six times longer to complete than most other instructions. Many LCD libraries have a problem with this, especially if they do not account for displays that are at the low end of (or below) the speed specifications.

Don

Im not specifically calling the clear() procedure, however the init() procedure in the libraries codes uses it to clear the screen on startup.