How to update values from I2C in Simulink using Arduino hardware for the MMA8541 Accelerometer
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have followed the tutorial listed on to connect my MMA8541 Accelerometer to an Arduino Uno using Simulink. Iunderstand that the board in the tutorial is different, but I doubt that is the problem, as it should work in a similar fashion: https://ww2.mathworks.cn/help/supportpkg/freedomboard/examples/read-acceleration-data-from-the-onboard-mma8451q-3-axis-digital-accelerometer-via-i2c.html
Unfortunately, no matter how much i research and try various things, I cannot manage to get it to work. This is what my "main" simulink block looks like:
The board I am using is the Arduino Uno. I am trying to connect it using I2C. When I do so, no error shows, I this is what i see when I execute the .slx file:
My read configuration:
The output I get stays the same, it doesn't change one bit... Could someone please help me? Ii attached the file below just in case
0 Commenti
Risposte (1)
Nagasai Bharat
il 28 Set 2020
Hi,
As the tutorial is given for the onboard accelerometer and the hardware architecture for FRDM Board would be different from Arduino Uno and hence leading to the issue.
Try going through the datasheet for the accelerometer you are using and get the registers right.
Try the model in the above model as it could be of some help.
Vedere anche
Categorie
Scopri di più su Modeling in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!