Main Content

Analog Input

Measure the voltage of an analog input pin

Add-On Required: This feature requires the Simulink Coder Support Package for NXP FRDM-KL25Z Board add-on.

Library

Simulink Coder Support Package for NXP FRDM-KL25Z Board/ FRDM-KL25Z

  • Analog Input block

Description

Measure the voltage of the selected analog input pin A0-A5. The block output emits a value in the range 0.0 to 1.0 with 16 bit resolution. The maximum voltage is determined by the input reference voltage, VREFH, which defaults to a 3.3 Volt source.

During simulations without the hardware, this block emits zeroes.

Parameters

Analog pin

Select the analog pin from A0-A5 to measure the voltage. Make sure not to select the same pin number for multiple blocks in your model.

Sample time

Specify how often this block reads the pin value, in seconds.

View pin map

Click on this button to open a snapshot of the board with a reference to the GPIO pins.