Be the first to rate this file! 86 downloads (last 30 days) File Size: 145.56 KB File ID: #24675

Arduino Target

by Doug Eastman

 

09 Jul 2009 (Updated 01 Oct 2009)

Code covered by BSD License  

Develop applications for the Arduino platform using Simulink®.

Download Now | Watch this File

File Information
Description

Arduino (www.arduino.cc) is a low-cost open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. Arduino Target allows you to develop applications for the Arduino platform right from Simulink. The target includes blocks to interface with the I/O ports on the Arduino board as well as a target file that automatically compiles and downloads the application onto the board directly from Simulink.

For more information and installation instructions, see GettingStarted.html.

Required Products Real-Time Workshop
Real-Time Workshop Embedded Coder
Simulink
MATLAB release MATLAB 7.8 (R2009a)
Other requirements Arduino Environment Only tested in Windows
Zip File Content  
HTML Files Getting Started with the Arduino Target
Other Files
arduino/arduino.tlc,
arduino/arduino.tmf,
arduino/arduino_default_set.m,
arduino/arduino_file_process.tlc,
arduino/arduino_make_rtw_hook.m,
arduino/arduino_opt_callback.m,
arduino/arduino_srmain.tlc,
arduino/arduinoTargetOptions.mat,
blocks/analog_input.c,
blocks/analog_input.mexw32,
blocks/analog_input.tlc,
blocks/analog_output.c,
blocks/analog_output.mexw32,
blocks/analog_output.tlc,
blocks/arduino_lib.mdl,
blocks/digital_input.c,
blocks/digital_input.mexw32,
blocks/digital_input.tlc,
blocks/digital_output.c,
blocks/digital_output.mexw32,
blocks/digital_output.tlc,
blocks/LCD_output.c,
blocks/LCD_output.mexw32,
blocks/LCD_output.tlc,
blocks/servo_output.c,
blocks/servo_output.mexw32,
blocks/servo_output.tlc,
blocks/sfcn_serialConfig.c,
blocks/sfcn_serialConfig.mexw32,
blocks/sfcn_serialConfig.tlc,
blocks/sfcn_serialRead.c,
blocks/sfcn_serialRead.mexw32,
blocks/sfcn_serialRead.tlc,
blocks/sfcn_serialWrite.c,
blocks/sfcn_serialWrite.mexw32,
blocks/sfcn_serialWrite.tlc,
blocks/slblocks.m,
examples/blink.mdl,
examples/serialCommunication.mdl,
examples/serialMonitor.mdl,
GettingStarted.m,
installArduino.m,
license.txt
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
08 Nov 2009 Matthew

The code for "installArduino" has several tilde which do not pass the MATLAB compiler. As an example the very first line:
function installArduino(~) produces the error:
??? Error: File: installArduino.m Line: 1 Column: 25
Unexpected MATLAB operator.

The tilde exists at the location listed and stops the install program from executing. This same problem will cause the installation program to seize at several other points:
Line: 240 Column: 29 & 33
Line: 253 Column: 32
Line: 275 Column: 31
etc . . .

I am very interested in the practicality of this MATLAB & Simulink application. Please fix these problems so I can make good use of MATLAB and Arduino.
Thank you.

10 Nov 2009 Doug Eastman

Hi Matthew, the ~ is a new construct that was introduced in R2009b. The files will be updated shortly with a version without ~'s that works in R2009a and latter. In the meantime, you can simply replace the ~'s with valid variable names (x1, x2, etc.).

Please login to add a comment or rating.
Updates
01 Oct 2009

Added support for multiple chips including ATmega328, ATmega168, ATmega8, and ATmega1280. Also improved the installation script, added support for newest Arduino IDE, and added more information about serial communication in the Getting Started Guide.

Tag Activity for this File
Tag Applied By Date/Time
arduino Robert Bemis 17 Aug 2009 08:50:19
simulink target Doug Eastman 17 Aug 2009 18:42:07
arduino Doug Eastman 17 Aug 2009 18:43:42
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com