Analog Output
Generate voltage on the specified DAC pin
Add-On Required: This feature requires the Simulink Support Package for Arduino Hardware add-on.
Libraries:
Simulink Support Package for Arduino Hardware /
Common
Description
The Analog Output block generates voltage on the specified DAC pin of the board.
You can run a Simulink® model containing Analog Output block in Connected IO mode on Arduino® boards.
Supported Arduino Boards
Arduino Due
Arduino Nano 33 BLE Sense
Arduino MKR 1000
Arduino MKR Zero
Arduino MKR Wi-Fi® 1010
Arduino Nano 33 IoT
Arduino compatible ESP32 – WROOM and ESP32 – WROVER
Arduino Uno R4 Wi-Fi
Arduino Uno R4 Minima
The block outputs voltage
(Vout
) on the DAC
pin, such that:
Vout = VrefX(input/2N-1)+ Voffset
This table explains the variables in the formula.
Variable | Arduino Boards | Description | |||
---|---|---|---|---|---|
Arduino Due, Arduino 33 BLE Sense | Arduino MKR1000, Arduino MKR Wi-Fi 1010, Arduino ZERO, Arduino Nano 33 IoT | Arduino Uno R4 Wi-Fi, Arduino Uno R4 Minima | Arduino Compatible ESP32 boards | ||
Vref | 2.2 | 3.27 | 5 | 3.3 | Reference voltage for the DAC pin. |
input | 0 < input < 4095 | 0 < input < 1023 | 0 < input < 4095 | 0 < input < 255 | Input voltage to the block must lie within this range. Any value outside the given range saturates the voltage output at the DAC pin. |
N | 12 | 10 | 12 | 8 | Number of bits on DAC channel. |
Voffset | 0.56 | 0.007 | 0 | 0 | Offset voltage on Arduino board. |
Ports
Input
Parameters
Version History
Introduced in R2014a