コード例 #1
0
ファイル: Compressor.cpp プロジェクト: jwhite66/jpw-wpilib
/**
 * Compressor constructor.
 * Given a relay channel and pressure switch channel (both in the default digital module), initialize
 * the Compressor object.
 * 
 * You MUST start the compressor by calling the Start() method.
 * 
 * @param pressureSwitchChannel The GPIO channel that the pressure switch is attached to.
 * @param compressorRelayChannel The relay channel that the compressor relay is attached to.
 */
Compressor::Compressor(UINT32 pressureSwitchChannel, UINT32 compressorRelayChannel)
	: m_task ("Compressor", (FUNCPTR)CompressorChecker)
{
	InitCompressor(GetDefaultDigitalModule(),
			pressureSwitchChannel,
			GetDefaultDigitalModule(),
			compressorRelayChannel);
}
コード例 #2
0
/**
 * Relay constructor given a channel only where the default digital module is used.
 * @param channel The channel number within the default module for this relay.
 * @param direction The direction that the Relay object will control.
 */
Relay::Relay(UINT32 channel, Relay::Direction direction)
	: m_channel (channel)
	, m_direction (direction)
{
	InitRelay(GetDefaultDigitalModule());
}
コード例 #3
0
ファイル: PWM.cpp プロジェクト: jwhite66/jpw-wpilib
/**
 * Allocate a PWM in the default module given a channel.
 * 
 * Using a default module allocate a PWM given the channel number.  The default module is the first
 * slot numerically in the cRIO chassis.
 * 
 * @param channel The PWM channel on the digital module.
 */
PWM::PWM(UINT32 channel)
	: m_module(NULL)
{
	InitPWM(GetDefaultDigitalModule(), channel);
}
コード例 #4
0
ファイル: DigitalOutput.cpp プロジェクト: FRC980/FRC-Team-980
/**
 * Create an instance of a digital output.
 * Create a digital output given a channel. The default module is used.
 */
DigitalOutput::DigitalOutput(UINT32 channel)
{
    InitDigitalOutput(GetDefaultDigitalModule(), channel);
}
コード例 #5
0
/**
 * Set the upsource for the counter as a digital input channel.
 * The slot will be the default digital module slot.
 */
void xCounter::SetUpSource(UINT32 channel)
{
	if (StatusIsFatal()) return;
	SetUpSource(GetDefaultDigitalModule(), channel);
	m_allocatedUpSource = true;
}
コード例 #6
0
ファイル: DigitalInput.cpp プロジェクト: FRC2404/year2014
/**
 * Create an instance of a Digital Input class.
 * Creates a digital input given a channel and uses the default module.
 *
 * @param channel The digital channel (1..14).
 */
DigitalInput::DigitalInput(uint32_t channel)
{
	InitDigitalInput(GetDefaultDigitalModule(), channel);
}
コード例 #7
0
/**
 * Set the upsource for the counter as a digital input channel.
 * The slot will be the default digital module slot.
 */
void Counter::SetUpSource(UINT32 channel)
{
	SetUpSource(GetDefaultDigitalModule(), channel);
}
コード例 #8
0
ファイル: PWM.cpp プロジェクト: HiceS/synthesis
/**
* Allocate a PWM in the default module given a channel.
* 
* Using a default module allocate a PWM given the channel number.  The default module is the first
* slot numerically in the cRIO chassis.
* 
* @param channel The PWM channel on the digital module.
*/
PWM::PWM(uint32_t channel)
	: m_module(NULL)
{
	InitPWM(GetDefaultDigitalModule(), channel);
}