ARDUINO IO (Also Known As: "TETHERED" MATLAB SUPPORT PACKAGE FOR ARDUINO):
This package allows using an Arduino connected to the computer to perform
Analog and Digital Input and Output, (and command motors) from MATLAB.
---------------------------------------------------------------------------
DETAILS ABOUT ARDUINO:
Arduino is a powerful and inexpensive open-source microcontroller board,
with an associated development environment: http://arduino.cc/
An extensive Knowledge base can be found here: http://www.freeduino.org/
BUYING AN ARDUINO BOARD:
An extensive list of sites where you can buy an Arduino is here:
http://www.arduino.cc/en/Main/Buy
In the US, adafruit industries (http://www.adafruit.com/)
provides a starter pack that includes pretty much everything that you
need to get started with the board.
While earlier version of this package were targeted at smaller boards like
the Uno and Nano, since August 2012 (ver 3.3) the package also works right
out of the box on the Mega boards, without requiring any Mega-related tweaking.
GETTING STARTED GUIDES:
The official getting started guide is here : http://arduino.cc/en/Guide/HomePage
and a very good tutorial is here: http://www.ladyada.net/learn/arduino/
However note that for the purpose of using this package you only need to have
the IDE environment installed but you won't need to use it, because you can
do all the programming in MATLAB.
CHIP KIT 32 BOARDS:
Note that the the package works fine with the ChipKit32 boards (Uno32, Max32):
http://www.digilentinc.com/Products/Catalog.cfm?NavPath=2,892&Cat=18
All of the analog and digital input and output functionality work fine,
but unfortunately not all the interrupts functionalities work in the same
way, so servos and encoders might not work exactly as on the Arduino boards.
Since Sep 2012, when the AFMotor library was updated to support PIC32,
the Adafruit Motor Sield also works with these boards.
The Cerebot MX7ck also works fine with the package. Note that in order to be
accessed with the MPIDE you need to short jumper JP11, set the switch to ON,
and connect it to the PC through the UART (not the DEBUG) usb port.
If you don't have external power then make sure to also set the power
jumper to UART (as opposite to the default position DBG).
TI LAUNCHPAD (MSP430) BOARDS:
Using the Energia IDE (http://energia.nu/Guide_MSP430LaunchPad.html)
the adio.pde and adioe.pde can be compiled for the MSP430G2553 and
MSP430G2452 (the G2231 does not have enough memory). The adioes.pde sketch
can be compiled for the FR5739. Note however that no real testing has been
performed on these platforms though.
---------------------------------------------------------------------------
DOWNLOADING AND INSTALLING THE IDE (to be done only once):
A step by step driver installation can be found at:
http://arduino.cc/en/Guide/HomePage and there is no need to duplicate it here.
It is a good idea to go trought all the 9 steps, although after you have
installed the drivers, maybe the shield library, and verified that the IDE
can communicate with the Arduino, you can already start using this package.
INSTALLING THE ADAFRUIT MOTOR SHIELD LIBRARY (to be done only once):
If you want to use this package with the ADAFRUIT motor shield, (either
version 1: http://learn.adafruit.com/adafruit-motor-shield or version 2:
http://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino ), you need
to download and install the respective adafruit motor shield library
(follow instructions given in the above sites, which amount to download
a zip file and unzip it into the arduino-1.X/libraries folder.
As better explained in the next step, this you will also need to upload
eiter the motor_v1.pde or the motor_v2.pde sketch on the board.
NOTE that if you don't have the adafruit motor shield and you don't plan
to use it, you might also SKIP THIS STEP.
Also note that the "official" Arduino (not Adafruit) motor shield:
(http://arduino.cc/it/Main/ArduinoMotorShieldR3)
does not require any additional library, works fine with the chipkit32
boards, and can be used with this package right away. Therefore if you
plan to use the official motor shield then you can safely skip this step.
---------------------------------------------------------------------------
UPLOAD ADIOES.PDE TO THE ARDUINO BOARD (to be done only once):
The adioes.pde sketch is the "server" program that will continuously run
on the microcontroller board. It listens for MATLAB commands arriving from
the serial port, executes the commands, and, if needed, returns a result.
The following instructions are needed to upload the adioes.pde file into
the controller's flash memory. As long as no other file is uploaded later,
this step does not need to be repeated anymore, and the package can be
used as soon as the board is connected to the computer.
Note that if you want to use the adafruit shield library then you need to
both install the appropriate library (see previous step) and upload the
the appropriate sketch (either motor_v1.pde or motor_v2.pde) instead of
the adioes.pde sketch.
From the Arduino IDE, go to File > Open, locate the file adioes.pde,
(in the ArduinoIO/pde/adioes folder) and open it. If a dialog appears
asking for the permission to create a sketch folder and move the file,
press OK (this will create an adioes folder and move the adioes.pde
file inside it).
Connect the Arduino, make sure that the right board and serial port are
selected in the IDE, (Tools/Board and Tool/Serial Port) then select
File -> Upload to I/O Board and wait for the "Done Uploading" message.
At this point the adioes.pde file is uploaded and you can close the IDE,
which is not needed anymore for the purpose of this package. Actually
closing the IDE is suggested, so you can be sure that the serial connection
to the arduino board is not taken by the IDE when matlab needs to use it.
---------------------------------------------------------------------------
PACKAGE INSTALLATION (to be done only once):
When installing the Arduino IO package on your operating system it is
important that users have the right to access the serial port and modify
the pathdef.m file.
ON LINUX:
---------
To make sure that the pathdef.m file is writable, issue a command like this:
sudo chmod 777 usr/local/matlab/R2012a/toolbox/local/pathdef.m
(modify the path above according to where MATLAB is installed).
Also, still on Linux, create a symbolic link as follows:
sudo ln -s /dev/ttyACM0 /dev/ttyS101
and make sure it is accessible by any user:
sudo chmod 777 /dev/ttyS101
Forgetting this last step might lead to a serial port which is
unaccessible by a normal user (therefore being grayed-out in the IDE).
Then from MATLAB, launch the "install_arduino" command, this will simply
add the relevant ArduinoIO folders to the matlab path and save the path.
ON WINDOWS:
-----------
Run MATLAB as administrator (just one time for the purpose of installing
the package) by right-clicking on the MATLAB icon and selecting
"Run as Administrator". This will allow the updated path to be saved.
Then from MATLAB, launch the "install_arduino" command, this will simply
add the relevant ArduinoIO folders to the matlab path and save the path.
---------------------------------------------------------------------------
TYPICAL USAGE:
Make sure the board is connected to the computer via USB port, make sure
you know which serial port the Arduino is connected to (this is the same
port found at the end of the drivers installation step), and finally,
make sure that the port is not used by the IDE (in other words, the IDE must
be closed or disconnected), so that MATLAB can use the serial connection.
From MATLAB, launch the command a=arduino('port') where 'port' is the
COM port to which the Arduino is connected to, e.g. 'COM5' or 'COM8' on Windows,
or '/dev/ttyS101' on Unix (use '/dev/ttyUSB0' for Arduino versions prior to Uno)
o
没有合适的资源?快使用搜索试试~ 我知道了~
pachecoUTD-week04_ECS120_BMEN_Fall2014
共51个文件
m:28个
mdl:10个
html:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 36 浏览量
2023-08-09
18:30:44
上传
评论
收藏 180KB ZIP 举报
温馨提示
pachecoUTD-week04_ECS120_BMEN_Fall2014
资源推荐
资源详情
资源评论
收起资源包目录
pachecoUTD-week04_ECS120_BMEN_Fall2014-archive-refs-heads-master.zip (51个子文件)
pachecoUTD-week04_ECS120_BMEN_Fall2014-archive-refs-heads-master
新建文本文档.txt 0B
week04_ECS120_BMEN_Fall2014-master
ArduinoIO
arduino.m 97KB
pde
adio
adio.pde 10KB
motor_v1
motor_v1.pde 33KB
adioe
adioe.pde 22KB
adioes
adioes.pde 26KB
motor_v2
motor_v2.pde 33KB
mytest.m 0B
contents.m 4KB
examples
encoder_sim.mdl 20KB
blink_challenge.m 3KB
blink_challenge_sim.mdl 48KB
example_encoders.m 971B
blink_led_sim.mdl 19KB
example_mot.m 2KB
blink_challenge_sch.mdl 74KB
example_io.m 1KB
servo_sim.mdl 20KB
html
example_servos.html 7KB
example_encoders.html 7KB
example_mot.html 9KB
example_io.html 8KB
blink_challenge_sf.mdl 45KB
library_test.mdl 26KB
example_servos.m 946B
motor_sim.mdl 19KB
stepper_sim.mdl 23KB
install_arduino.m 1KB
simulink
msfun_arduino_servowrite.m 4KB
msfun_arduino_stepper.m 4KB
realtime_pacer_help.html 2KB
realtime-pacer-license.txt 2KB
msfun_arduino_io_setup.m 4KB
msfun_arduino_encoderread.m 4KB
msfun_arduino_encoderreset.m 4KB
arduinoCleanup.m 2KB
getSetupBlockUserData.m 1KB
msfun_arduino_servoread.m 4KB
msfun_realtime_pacer.m 4KB
msfun_arduino_digitalwrite.m 3KB
msfun_arduino_analogwrite.m 3KB
msfun_arduino_dcmotor.m 4KB
slblocks.m 185B
msfun_arduino_digitalread.m 3KB
arduino_io_lib.mdl 57KB
msfun_arduino_analogread.m 3KB
readme.txt 27KB
test_setup.m 671B
week04_demo.m 1KB
week04_count_in_binary.m 1KB
week04_flash_onBoard_LED.m 1KB
共 51 条
- 1
资源评论
AbelZ_01
- 粉丝: 904
- 资源: 5441
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功