Difference between revisions of "Arduino Target for Simulink"

From Matt Bilsky

(Installing the Arduino Package)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Installing the Arduino Package ==
+
== Installing the Arduino Package in Simulink 2011 ==
  
 
=== To install the Arduino Target for Simulink: ===
 
=== To install the Arduino Target for Simulink: ===
Line 5: Line 5:
 
#Download the package located here: http://www.mathworks.com/matlabcentral/fileexchange/30277
 
#Download the package located here: http://www.mathworks.com/matlabcentral/fileexchange/30277
 
#Extract the zip file to an easy to find location (i.e. C:/arduinoTarget)
 
#Extract the zip file to an easy to find location (i.e. C:/arduinoTarget)
 +
*Note that it is important to select a folder that has no spaces in the path
 
#Follow the installation instruction located at C:/arduinoTarget/README.txt
 
#Follow the installation instruction located at C:/arduinoTarget/README.txt
  
Line 10: Line 11:
 
*We are going to use the Arduino IDE version 23 which may be downloaded here: http://arduino.cc/en/Main/Software. Just extract the archive to an easy to located directory (i.e. your desktop)
 
*We are going to use the Arduino IDE version 23 which may be downloaded here: http://arduino.cc/en/Main/Software. Just extract the archive to an easy to located directory (i.e. your desktop)
 
*As stated in the README file, PIL (processor in the loop) mode is only supported in matlab 2011b or later. This guide was written using 2011a.
 
*As stated in the README file, PIL (processor in the loop) mode is only supported in matlab 2011b or later. This guide was written using 2011a.
 +
 +
=== Configuring IDE Model ===
 +
At the Matlab command prompt execute the following:
 +
 +
#Set the path of your Arduino IDE: arduino.Prefs.setArduinoPath('c:\Program Files\arduino\arduino-0023')
 +
#To see a list of supported Arduino boards: arduino.Prefs.setBoard
 +
#Choose your specific board: arduino.Prefs.setBoard('uno')
 +
#Search for available COM ports: comPorts=arduino.Prefs.searchForComPort
 +
#Set your COM port: arduino.Prefs.setComPort('COM9');
 +
 +
=== Available Demos from MathWorks ===
 +
 +
Type the name of the demonstration at the Matlab command prompt to launch the model
 +
 +
*demo_arduino_blink
 +
*demo_arduino_blink_challenge
 +
*demo_arduino_blink_challenge_stateflow
 +
*demo_arduino_serial_communication
 +
*demo_arduino_serial_communication_host
  
  
 
=== Below is a video showing the install process performed in Simulink 2011a ===
 
=== Below is a video showing the install process performed in Simulink 2011a ===
 +
(Set playback to 720p for a clearer picture)
  
 
{{#ev:youtube|W8488x1Lt2o}}
 
{{#ev:youtube|W8488x1Lt2o}}

Latest revision as of 17:27, 2 May 2012

Installing the Arduino Package in Simulink 2011

To install the Arduino Target for Simulink:

  1. Download the package located here: http://www.mathworks.com/matlabcentral/fileexchange/30277
  2. Extract the zip file to an easy to find location (i.e. C:/arduinoTarget)
  • Note that it is important to select a folder that has no spaces in the path
  1. Follow the installation instruction located at C:/arduinoTarget/README.txt

Note the following changes to the instructions from MathWorks:

  • We are going to use the Arduino IDE version 23 which may be downloaded here: http://arduino.cc/en/Main/Software. Just extract the archive to an easy to located directory (i.e. your desktop)
  • As stated in the README file, PIL (processor in the loop) mode is only supported in matlab 2011b or later. This guide was written using 2011a.

Configuring IDE Model

At the Matlab command prompt execute the following:

  1. Set the path of your Arduino IDE: arduino.Prefs.setArduinoPath('c:\Program Files\arduino\arduino-0023')
  2. To see a list of supported Arduino boards: arduino.Prefs.setBoard
  3. Choose your specific board: arduino.Prefs.setBoard('uno')
  4. Search for available COM ports: comPorts=arduino.Prefs.searchForComPort
  5. Set your COM port: arduino.Prefs.setComPort('COM9');

Available Demos from MathWorks

Type the name of the demonstration at the Matlab command prompt to launch the model

  • demo_arduino_blink
  • demo_arduino_blink_challenge
  • demo_arduino_blink_challenge_stateflow
  • demo_arduino_serial_communication
  • demo_arduino_serial_communication_host


Below is a video showing the install process performed in Simulink 2011a

(Set playback to 720p for a clearer picture)