Beruflich Dokumente
Kultur Dokumente
University of Jordan
Course coordinator:
Mohammad AlShawabkeh/ B.Sc student Mechatronics engineering 09 Eng91moh@hotmail.com +962797150681
Prerequisites:
Created by: Mohammad AlShawabkeh Mechatronics Engineering/B.Sc. Student Faculty of Engineering & Technology The University of Jordan Madaba, Jordan www. eng91moh.blogspot.com Mobile/Cellphone: +962 797150681
Highlights: allows you to create Simulink applications that will run autonomously on your Arduino board. Using Simulink Coder and Embedded Coder, the Simulink model is automatically converted to readable C code, compiled, and downloaded to the Arduino.
2.
3.
B. Arduino Target:
A. http://www.mathworks.com.
B.
C.
D.
E.
F.
Or: http://www.mathworks.com/matlabcentral/fileexchange/30277-embedded-codersupport-package-for-arduino
4.
4. Add the subfolders arduino, demos and blocks to your MATLABPATH, e.g. by typing the following commands in the MATLAB command window:
If the savepath command does not work, you may need to invoke MATLAB in administrator mode. For more information, see http://www.mathworks.com/support/solutions/en/data/1-9574H9/
>> sl_refresh_customizations
7. Set up preferences. These are persistent across MATLAB sessions, so you don't have to specify them each time you start MATLAB.
>> arduino.Prefs.setBoard
>> comPorts=arduino.Prefs.searchForComPort
If the above command doesn't show any ports, open Windows Device Manager (http://technet.microsoft.com/en-us/library/cc754081.aspx), navigate to "Ports (COM & LPT)", and look for ports labeled "USB Serial Port" or "Arduino"
>> arduino.Prefs.setComPort('COM9'); 8. Open your project's Simulink file. 9. Use Arduino Target:
11. Change the "Code Generation" options: A. Tools > Code Generation>>Options>>
>>OK 12. Build and deploy the executable by pressing Ctrl+B, or choosing Tools > Code Generation > Build Model.
13. If you want to use this library later, you have to write this command in the MATLAB command window: >> cd c:\ArduinoTarget
*References: 1. Books: A. Practical Electronics for Inventors, Paul Scherz, Copyright 2000 by The McGraw-Hill Companies. All rights reserved. B. Introduction to Simulink with Engineering Applications, Steven T. Karris, Copyright 2006 Orchard Publications. All rights reserved. C. Designing Embedded Systems with PIC Microcontrollers, Second Edition,Copyright 2010, Tim Wilmshurst. Published by Elsevier Ltd. All rights reserved. 2.Websites: A. B. Arduino.cc Mathworks.com