Measure analog voltage applied to an ADC channel
UAV Toolbox Support Package for PX4 Autopilots / PX4 Utility Blocks
The PX4 Analog Input block measure the analog voltage at the ADC channels on the PX4 flight controller hardware, and outputs the voltages as a 1-by-12 array. Each value in the array corresponds to the analog voltage at a particular channel number.
For more information about mapping the channel numbers and the voltage array, see Index Numbers for Analog Channels on Pixhawk Series Controller Boards.
Port_1— Voltage values represented as a 1-by-12 array
The voltage values captured at the different ADC channels on the flight controller board.
Connect this output to a Selector block with its
size parameter value set to
12. You can use the
Selector block to specify the index values of the required channel numbers from which
you want to read the voltage values.
Sample time— Interval at which the block reads analog voltage values
0.001(default) | any non-negative value that is a multiple of 0.001 | -1
Enter the time interval at which the block reads voltage values from the ADC channels on the flight controller board.
When you set this parameter to
-1, Simulink® determines the best sample time for the block based on the block context
within the model.