Interfacing Arduino with Simulink and embedded M Code

Hi, I am using an ultrasonic sensor HC-SR04 which has the ping pin separated but i wasnt able to time the returned echo or even pinging the sensor. (in simulink) how did you manage that? if your issue is only in separating the pins you can try connecting 2 pins to the ping pin. one to read and one to ping. and add a resistor to the read pin so it wont short circuit and burn (if it has no internal resistors, i`m not sure at that).

In addition as a fellow matlab user do you have an idea how to read sensors using I2C protocol via simulink?