- Getting started - https://www.mathworks.com/help/simulink/supportpkg/arduino_ug/io-device-builder.html
- Interfacing DHT11 sensor with Arduino using IO Device Builder - https://www.mathworks.com/help/simulink/supportpkg/arduino_ref/dht11-relative-humidity-temperature-io-device-builder.html
- Interfacing ADXL343 sensor with Arduino - https://www.mathworks.com/help/simulink/supportpkg/arduino_ref/adxl343-read-acceleration-io-device-builder.html
display data on i2c lcd arduino using simulink f-function builder (matlab 2021a)
22 views (last 30 days)
Show older comments
i want to display a data on my i2c lcd using simulink s-function builder and i did all the steps i got this probleme
helpp me pleasee !!!!!!!

0 Comments
Answers (1)
Aravind
on 25 Jun 2025
From the code and error you have shared, it appears that you are using Arduino-specific libraries for the LCD display. These libraries internally rely on the "Wire.h" library for I2C communication with the LCD.
When you try to use the Arduino LCD display library directly within the S-Function Builder, the additional Arduino-specific dependencies it requires—such as "Wire.h"—are not available in Simulink. This leads to the error you are encountering.
To resolve this issue, the recommended approach is to use the "IO Device Builder" app, which is part of the "Simulink Support Package for Arduino Hardware." This app allows you to integrate custom or third-party C/C++ source files as a System object, which then becomes available as a block in Simulink.
Using this app, you can create a block that communicates directly with the LCD display using the Arduino-specific libraries, thereby avoiding the error you are seeing.
For more details on the "IO Device Builder" app, you can refer to the following documentation: https://www.mathworks.com/help/simulink/arduino-io-device-builder.html.
Additionally, here are a few tutorials to help you get started with the "IO Device Builder" app:
I hope this resolves your issue!
0 Comments
See Also
Categories
Find more on Arduino Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!