How to use a LCD i2c (iic, i²c, whatever you call it) shield with an arduino due?

8 views (last 30 days)
Hello,
I want to use a lcd i2c shield with an arduino due in Matlab/Simulink. The task sounds very simple: measure a temperature (LM35cz sensor) and show it on an lcd shield with an i2c interface. With the arduino software it's no problem, but I can't do it with Simulink.
I would appreciate a lot if somebody could help me with my problem.
Thanks in advance!
Sebastian
  5 Comments
Sebastian Fischer
Sebastian Fischer on 30 Jan 2018
Thank you for your answer.
Yes it's correct that I can use the LCD with Arduino code. I also tried to take a look in the libraries. Unfortunately I'm not familiar with C-Codes and I couldn't find the correct register adresses.
I tried to fix the problem now with the I2C Read/Write blocks as you said. And with a long time of studying the datasheet I could find the commands and the correct DDRAM adresses of the display.
The actual situiation is, that I know the slave device adresse of the LCD shield (0x27) and some commands. E.g. I want to write an "H". Then the command would be 1 0 0 1 0 0 1 0 0 0. When I take a look at the I2C write block in Simulink now, I have the slave device adress (0x27), the constant which I give in block ("H" --> dec.: 584). But I don't know in which register I have to write this constant value now. I tried to use the DDRAM adress but that did not work. In the attachement there is the small simulink model with the I2C write block where you can check what I did as well as the Libraries for the arduino software.
Thank you so much for your help! I really hope we can solve the problem.
Grant Sellers
Grant Sellers on 1 Feb 2018
Hi Sebastian,
It sounds like the issue here lies more in the inner-workings of communication with the LCD, rather than with how to do communication in Simulink. As a result, I think you may find additional help on a forum like Stack Exchange. You may also be able to contact the device manufacturer or the developer of the Arduino library for help.
If it comes back to an issue with Simulink, then this will be the place.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!