Measure frequency and duty cycle of external input signal
Simulink Support Package for Arduino Hardware / Common
The Input Capture block measures the frequency and duty cycle of the external input signal on the digital pin of the Arduino®hardware board. The block utilizes the timer counters available on the Arduinohardware board along with the interrupt service routines to compute the frequency and duty cycle of the external input signal.
For more information on the conflicting usage of digital pins for a Simulink® model that uses one or more combination of PWM, Standard Servo Read, Standard Servo Write, Continuous Servo Write, and Input Capture blocks, see the Conflicting Pin Configurations on Arduino Timer section.
The Input Capture block does not support the Arduino Nano 33 BLE Sense board currently.
|Arduino Board Architecture||Maximum Measurable Frequency||Measurable Duty Cycle Range|
Frequency— Frequency of external input signal
The block outputs the frequency of the external input signal in Hertz.
Duty Cycle— Duty cycle of external input signal
The block outputs the duty cycle of the external input signal as a percentage.
Input capture pin number— Pin to which external input signal is connected
48(default) | scalar
Enter the Arduino hardware board pin number to which the external input signal is connected.
Do not assign the same pin number to multiple blocks within a model.
To know more on how to assign pins or to view the fixed pins for the Input Capture block, see Pin Mapping for Arduino Timer Dependent Blocks.
Sample Time— Time interval at which external input signal is read
0.1(default) | scalar
Enter the time interval in seconds at which the block reads the external input signal from the specified pin number.