Analog Input
Measure voltage of specified analog input pin
Libraries:
Simulink Coder Support Package for BeagleBone Blue Hardware /
Basic
Description
This block measures the voltage of a specified analog input pin. The block outputs the measurement as a double value.
Ports
Output
Port_1 — Voltage of analog input pin
scalar
Measure the voltage of an analog pin relative to the analog input reference
voltage on the BeagleBone® Blue hardware. If the measured voltage equals the ground voltage, the
block outputs 0
in raw mode, and 0
in volt mode.
If the measured voltage equals the analog reference voltage, the block outputs
4096
in raw mode, and 1.8
in volt mode.
Data Types: double
Parameters
Pin — Pin number of the analog input pin
AIN0 (default) | AIN1 | AIN2 | AIN3 | LIPO Battery | DC Jack
Specify the pin number.
To open the pin mapping table, click View pin map.
Make sure to assign different pin numbers to the different blocks of your model.
Mode — Mode to read output voltage
Raw (default) | Volt
Raw - The block outputs the voltage as a 12-bit digital value.
Volt - The block outputs the voltage in volts
Sample time — Frequency at which the block reads the input pin value
0.1 (default)
Specify how often this block measures the voltage of the analog input pin, in seconds.
When you specify this parameter as-1
, Simulink® determines the best sample time for the block based on the block context
within the model.
Version History
Introduced in R2018b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)