本文整理汇总了Java中edu.wpi.first.wpilibj.DriverStationEnhancedIO类的典型用法代码示例。如果您正苦于以下问题:Java DriverStationEnhancedIO类的具体用法?Java DriverStationEnhancedIO怎么用?Java DriverStationEnhancedIO使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DriverStationEnhancedIO类属于edu.wpi.first.wpilibj包,在下文中一共展示了DriverStationEnhancedIO类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SetBumpersColor
import edu.wpi.first.wpilibj.DriverStationEnhancedIO; //导入依赖的package包/类
public void SetBumpersColor(){
double ColorValue = 0;
try {
ColorValue = DriverStation.getInstance().getEnhancedIO().getAnalogIn(6);
} catch (DriverStationEnhancedIO.EnhancedIOException ex) {
ex.printStackTrace();
}
if(ColorValue > 1.5){
ColorLedsRelay.set(Relay.Value.kForward);
}
else{
ColorLedsRelay.set(Relay.Value.kReverse);
}
}
示例2: ButtonBoard
import edu.wpi.first.wpilibj.DriverStationEnhancedIO; //导入依赖的package包/类
private ButtonBoard() {
super("Button Board", 8);
try {
for (int i = 0; i < BUTTON_PINS.length; i++)
ioBoard.setDigitalConfig(BUTTON_PINS[i], DriverStationEnhancedIO.tDigitalConfig.kInputPullUp);
for (int i = 0; i < LED_PINS.length; i++) {
ioBoard.setDigitalConfig(LED_PINS[i], DriverStationEnhancedIO.tDigitalConfig.kOutput);
ioBoard.setDigitalOutput(LED_PINS[i], true);
}
} catch (EnhancedIOException ex) {
ex.printStackTrace();
}
}
示例3: processImage
import edu.wpi.first.wpilibj.DriverStationEnhancedIO; //导入依赖的package包/类
private void processImage() throws Exception {
DriverStationEnhancedIO dseio;
dseio = DriverStation.getInstance().getEnhancedIO();
if (imagePressed && !dseio.getDigital(1)) {
imagePressed = false;
}
if (!imagePressed && dseio.getDigital(1)) {
printToDash(2, "WOO");
imagePressed = true;
visControl.processImage();
}
}
示例4: Init
import edu.wpi.first.wpilibj.DriverStationEnhancedIO; //导入依赖的package包/类
public static void Init(DriverStationEnhancedIO driverStation) {
Controls.driverStation = driverStation;
}
示例5: FlashLedsPeriodic
import edu.wpi.first.wpilibj.DriverStationEnhancedIO; //导入依赖的package包/类
public void FlashLedsPeriodic(){
double flashTimeMs = 1;
try {
flashTimeMs = DriverStation.getInstance().getEnhancedIO().getAnalogIn(8) * 1000;
if(flashTimeMs > 2500){
flashTimeMs = 10000000;
}
} catch (DriverStationEnhancedIO.EnhancedIOException ex) {
ex.printStackTrace();
}
//System.out.println("FlashTime" + flashTimeMs);
if ((System.currentTimeMillis() - LastFlashTimeMs) > flashTimeMs){
// Initiate FLASH;
m_FlashState = false;
LastFlashTimeMs = System.currentTimeMillis();
}
else if ((System.currentTimeMillis() - LastFlashTimeMs) > (0.1 * flashTimeMs))
{
m_FlashState = true;
}
if (m_FlashState)
{
if (!m_bIsError)
{
FlashingLedsRelay.set(Relay.Value.kForward);
}
else
{
FlashingLedsRelay.set(Relay.Value.kReverse);
}
}
else
{
FlashingLedsRelay.set(Relay.Value.kOn);
}
}