code/WPILib/SolenoidBase.cpp
/**
 * Set the value of a solenoid.
 * 
 * @param value The value you want to set on the module.
 * @param mask The channels you want to be affected.
 */
Set the value of a solenoid.

@param value The value you want to set on the module.
@param mask The channels you want to be affected.
Set the value of a solenoid . @param value The value you want to set on the module . @param mask The channels you want to be affected .
void SolenoidBase::Set(UINT8 value, UINT8 mask)
{
	if (CheckSolenoidModule(m_chassisSlot))
	{
		Synchronized sync(m_semaphore);
		UINT8 currentValue = m_fpgaSolenoidModule->readDO7_0(SlotToIndex(m_chassisSlot), &status);
		currentValue = currentValue & ~mask;
		currentValue = currentValue | (value & mask);
		m_fpgaSolenoidModule->writeDO7_0(SlotToIndex(m_chassisSlot), currentValue, &status);
	}
	wpi_assertCleanStatus(status);
}
void SolenoidBase :: Set ( UINT8 value , UINT8 mask ) { if ( CheckSolenoidModule ( m_chassisSlot ) ) { Synchronized sync ( m_semaphore ) ; UINT8 currentValue = m_fpgaSolenoidModule -> readDO7_0 ( SlotToIndex ( m_chassisSlot ) , & status ) ; currentValue = currentValue & ~ mask ; currentValue = currentValue | ( value & mask ) ; m_fpgaSolenoidModule -> writeDO7_0 ( SlotToIndex ( m_chassisSlot ) , currentValue , & status ) ; } wpi_assertCleanStatus ( status ) ; }
Set the value of a solenoid.
Set the value of a solenoid .
// Zero out the values to change