Arduino (www.arduino.cc) is a low-cost open-source electronics prototyping platform.
MATLAB Support Package for Arduino (also referred to as "ArduinoIO Package") allows you to communicate with an Arduino Uno or Duemilanove over a serial port. It consists of a MATLAB API on the host computer and a server program that runs on the Arduino. Together, they allow you to access Arduino analog I/O, digital I/O, and motor shield from the MATLAB command line.
The Support Package also includes Simulink blocks for communicating with the Arduino.
For more information about the Support Package, see:
http://www.mathworks.com/academia/arduino-software/arduino-matlab.html
For Simulink blocks that support code generation, see:
http://www.mathworks.com/academia/arduino-software/arduino-simulink.html
Sample usage:
%-- connect to the board
a = arduino('COM9')
%-- specify pin mode
a.pinMode(4,'input');
a.pinMode(13,'output');
%-- digital i/o
a.digitalRead(4) % read pin 4
a.digitalWrite(13,0) % write 0 to pin 13
%-- analog i/o
a.analogRead(5)
a.analogWrite(9, 155) % write 155 to analog pin 9
%-- motor shield
a.motorRun(4, 'forward') % run motor forward
a.servoWrite(1, 175); % move servo#1 to 175 deg position
a.stepperStep(1, 'forward', 'double', 100); % move stepper motor
%-- close session
delete(a) |