Main Content

Latch

Latch the logical value based on the change in the input signal

Library

Simulink Coder Support Package for ARM Cortex-based VEX Microcontroller/Utilities

Simulink Coder Support Package for VEX EDR V5 Robot Brain/Utilities

  • Latch block

Description

Latch the logical value based on the change in the input signal between a zero and nonzero value. The Latch switches between 1 and 0 for every rising edge transition of the input signal. When you use this block to latch the output of a Gamepad Button block, the output switches between 1 and 0 when the specified button is pressed. When the button is released, the output does not switch. For instance, use this block in a model to press a button to latch the angular position of the robot arm or claw to a specific value. Switch to the original position by pressing the button again.

Parameters

Check if Initial Output is 1. Uncheck if 0

This parameter is applicable to simulation behavior only. If the initial output value must be 1, select this check box, . Otherwise, the initial output value is 0.