MATLAB Answers

How I can read data from VL53L0X in simulink?

13 views (last 30 days)
Héctor Maestre
Héctor Maestre on 4 Mar 2019
Edited: Jan on 27 Mar 2019
Hi.
I am trying to read the distance data of a VL53L0X sensor in simulink (I2C).
I successfully got to read the data in the workspace with the Adafruit library (https://github.com/sandorcourane/matlab-vl53l0x). However, I need to work in simulink because I want to do a PID and PWM to control a servo.
what is the best way to get the sensor data in simulink?
I thought to take the data from the workspace to simulink with the block 'from workspace', but I realized that I can not connect to the arduino board from the workspace of matlab and simulink at the same time.
I am using R2017a
Thank you in advance!

  2 Comments

Kieran Daw
Kieran Daw on 27 Mar 2019
PLEASE FOR THE LOVE OF GOD TELL ME HOW YOU GOT A SUCCESSFUL READ IN MATLAB!!!!
Jan
Jan on 27 Mar 2019
@Kieran Daw: Please remember that UPPERCASE means shouting in the forum. Calm down and ask a specific question. What is a "successful read"? What have you tried so far and what is your problem?

Sign in to comment.

Accepted Answer

Madhu Govindarajan
Madhu Govindarajan on 4 Mar 2019
Edited: madhan ravi on 5 Mar 2019
I would recommend creating your own block using the techniques described in this video - https://www.youtube.com/watch?v=qoj8Pa2wi0A

  1 Comment

Madhu Govindarajan
Madhu Govindarajan on 5 Mar 2019
If you end up creating your own block, I would like to request you to contribute the files to MATLAB File Exchange so that others can benefit from your work.

Sign in to comment.

More Answers (0)


Translated by