TeamCode/src/main/java/org/firstinspires/ftc/teamcode/libraries/ToggleButton.java
public boolean process(boolean button)
	{
		// if button did one of the enabled transitions, cycle the state of the value to the next one
		boolean changed = m_transitionOnDown && (!m_buttonValue && button) ||
						  m_transitionOnUp && (m_buttonValue && !button);
		if (changed)
			m_toggleValue = (m_toggleValue+1) % m_numStates;

		// remember the current state of the physical button
		m_buttonValue = button;

		return changed;
	}
// return true iff the state has changed, since that's when the caller might want to do something.
return true iff the state has changed, since that's when the caller might want to do something.
return true iff the state has changed since that ' s when the caller might want to do something .
public boolean process(boolean button)
	{
		boolean changed = m_transitionOnDown && (!m_buttonValue && button) ||
						  m_transitionOnUp && (m_buttonValue && !button);
		if (changed)
			m_toggleValue = (m_toggleValue+1) % m_numStates;
		m_buttonValue = button;
		return changed;
	}
public boolean process ( boolean button ) { boolean changed = m_transitionOnDown && ( ! m_buttonValue && button ) || m_transitionOnUp && ( m_buttonValue && ! button ) ; if ( changed ) m_toggleValue = ( m_toggleValue + 1 ) % m_numStates ; m_buttonValue = button ; return changed ; }
return true iff the state has changed, since that's when the caller might want to do something.
return true iff the state has changed since that ' s when the caller might want to do something .
// if button did one of the enabled transitions, cycle the state of the value to the next one // remember the current state of the physical button