Analog Input
Measure voltage of analog input pin
Libraries:
Simulink Coder Support Package
for BBC micro:bit/Basic
Simulink Coder Support Package for STMicroelectronics
Nucleo Boards/ Common
Simulink Coder Support Package for STMicroelectronics
Discovery Boards/ STM32F746G-Discovery
Simulink Coder Support Package for STMicroelectronics
Discovery Boards/ STM32F769I-Discovery
Description
The Analog Input block measures the voltage of an analog pin relative to the analog input reference voltage on the hardware. The block outputs the measurement as a float value in the range 0–1.
If the measured voltage equals the ground voltage, the block emits
0
.If the measured voltage equals the analog reference voltage, the block emits
1
.
During the external mode simulation, the block outputs the simulation results returned from the executable running on the target hardware.
During simulation in all other modes, the block outputs zeroes.