Read and Write Data
Create an Arduino object using
arduino before you use
read and write functions. See Connect to Arduino Hardware for more information. You can also use Arduino Explorer app to configure each pin of the Arduino to read and write data.
All functions, except
playTone, can be
used to generate code using the MATLAB Function block. For more
details, see Deploy Arduino Functions to Arduino Hardware Using MATLAB Function Block.
|Set Arduino pin mode|
|Read data from digital pin on Arduino hardware|
|Write data to digital pin on Arduino hardware|
|Generate PWM signal with specified voltage on digital pin|
|Generate PWM signal with specified duty cycle on digital pin|
|Play tone on piezo speaker using digital pin|
|Read voltage from analog pin on Arduino hardware|