Connection to the Arduino hardware
An arduino
object represents a connection to Arduino® hardware. Use the arduino
function to connect Arduino hardware to MATLAB®. After you create the object, you can program your hardware and use custom
add-on libraries directly from MATLAB using the object functions.
recreates the last successful
connection to the Arduino hardware. If there is no last successful connection or that connection
failed, it creates a connection to the first official Arduino hardware connected to your host computer via USB.a
= arduino
creates a connection with additional options specified by one or more
a
= arduino(___,Name,Value
)Name,Value
pair arguments.
The object functions device
, shiftRegister
, rotaryEncoder
, servo
, addon
, and ultrasonic
are used to create
objects for each of their respective peripheral devices. Other functions are used to interact
with the pins on your Arduino hardware.
device | Connection to device on I2C bus on Arduino hardware |
shiftRegister | Connection to shift register on Arduino hardware |
rotaryEncoder | Connection to quadrature encoder on Arduino hardware |
servo | Connection to servo motor on Arduino hardware |
addon | Connection to add-on device for Arduino hardware |
ultrasonic | Connection to ultrasonic sensor on Arduino hardware |
configurePin | Set Arduino pin mode |
readDigitalPin | Read data from digital pin on Arduino hardware |
writeDigitalPin | Write data to digital pin on Arduino hardware |
writePWMVoltage | Generate PWM signal with specified voltage on digital pin |
writePWMDutyCycle | Generate PWM signal with specified duty cycle on digital pin |
playTone | Play tone on piezo speaker using digital pin |
readVoltage | Read voltage from analog pin on Arduino hardware |
scanI2CBus | Scan I2C bus on Arduino hardware for device address |