当前位置: 首页>>代码示例>>Java>>正文


Java EnhancedIOException类代码示例

本文整理汇总了Java中edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException的典型用法代码示例。如果您正苦于以下问题:Java EnhancedIOException类的具体用法?Java EnhancedIOException怎么用?Java EnhancedIOException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EnhancedIOException类属于edu.wpi.first.wpilibj.DriverStationEnhancedIO包,在下文中一共展示了EnhancedIOException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ButtonBoard

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的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();
    }
}
 
开发者ID:grt192,项目名称:2013ultimate-ascent,代码行数:17,代码来源:ButtonBoard.java

示例2: get

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
public boolean get() {
    try {
        return DriverStation.getInstance().getEnhancedIO().getAnalogIn(port) < THRESHOLD;
    } catch (EnhancedIOException ex) {
        return false;
    }
}
 
开发者ID:frc-team-342,项目名称:wpilibj,代码行数:8,代码来源:AnalogIOButton.java

示例3: get

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
public boolean get(){
    try {
        return DriverStation.getInstance().getEnhancedIO().getDigital(port) == ACTIVE_STATE;
    } catch (EnhancedIOException ex) {
        return false;
    }
}
 
开发者ID:frc-team-342,项目名称:wpilibj,代码行数:8,代码来源:DigitalIOButton.java

示例4: setLED

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
/**
 * Set the state of an LED on the IO board.
 * @param channel
 * @param on
 */
public static void setLED(int channel, boolean on) {
    try {
        enhancedIO.setLED(channel, on);
    }
    catch (EnhancedIOException e) {
        Logger.log(e);
    }
}
 
开发者ID:SaintsRobotics,项目名称:Treecoil-2014,代码行数:14,代码来源:DriverStationComm.java

示例5: setLED

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
/**
 * Set the state of the LED lights.
 * @param channel the LED channel
 * @param on true to turn the LED on
 */
public static void setLED(int channel, boolean on) {
    try {
        driverStationIO.setLED(channel, on);
    } catch (EnhancedIOException exception) {
        Log.log(exception);
    }
}
 
开发者ID:SaintsRobotics,项目名称:FRC-2014-test,代码行数:13,代码来源:DriverStationComm.java

示例6: getIOAnalog

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
private double getIOAnalog(int port) {
    double in;
    try {
        in = io.getAnalogIn(port);
    }
    catch(EnhancedIOException ex) {
        return 0;
    }
    double refined = capAndBand(scaleAnalog(in));
    return refined;
}
 
开发者ID:johnzzhang,项目名称:Nutrons2013,代码行数:12,代码来源:OI.java

示例7: getIODigital

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
private boolean getIODigital(int port) {
    boolean in = false;
    try {
        in = !io.getDigital(port); //active low
    }
    catch(EnhancedIOException ex) {
    }
    return in;
}
 
开发者ID:johnzzhang,项目名称:Nutrons2013,代码行数:10,代码来源:OI.java

示例8: setLED

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
public void setLED(int index, boolean state)
{
    try
    {
        io.setLED(index, state);
    }
    catch (EnhancedIOException ex)
    {
        ex.printStackTrace();
    }
}
 
开发者ID:BadRobots1014,项目名称:BadRobot2013,代码行数:12,代码来源:HUD.java

示例9: setLED

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
/**
 * Set the state of an LED on the driver station.
 * 
 * @param num number of LED, from 1-3
 * @param on whether or not the LED is on
 */
public void setLED(int num, boolean on) {
    if (num <= 3 && num >= 1) {
        try {
            ioBoard.setDigitalOutput(LED_PINS[num - 1], !on);
        } catch (EnhancedIOException ex) {
            ex.printStackTrace();
        }
    }
}
 
开发者ID:grt192,项目名称:2013ultimate-ascent,代码行数:16,代码来源:ButtonBoard.java

示例10: getButtonState

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
/**
 * Get the state of a button.
 * 
 * @param num number of button, from 1-6
 * @return true if the button is pressed, false otherwise
 */
public boolean getButtonState(int num) {
    if (num <= 6 && num > 0) {
        try {
            return !ioBoard.getDigital(BUTTON_PINS[num - 1]);
        } catch (EnhancedIOException ex) {
            ex.printStackTrace();
        }
    }
    
    return false;
}
 
开发者ID:grt192,项目名称:2013ultimate-ascent,代码行数:18,代码来源:ButtonBoard.java

示例11: getPotentiometerState

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
/**
 * Get the state of a potentiometer.
 * 
 * @param num number of the potentiometer, from 1-6
 * @return the ratiometric turn of the potentiometer, from 0-1
 */
public double getPotentiometerState(int num) {
    if (num <= 2 && num > 0) {
        try {
            return ioBoard.getAnalogInRatio(POT_PINS[num - 1]);
        } catch (EnhancedIOException ex) {
            ex.printStackTrace();
        }
    }
    
    return Double.NaN;
}
 
开发者ID:grt192,项目名称:2013ultimate-ascent,代码行数:18,代码来源:ButtonBoard.java

示例12: debouncedValueDigital

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
public boolean debouncedValueDigital()
{
    try {
        //toggle logic: check to see if it's already pressed
        //System.out.println("Button State:  " + digital.get());
        //System.out.println("Button" +button+ " : " + digital.getDigital(button) + "Flag: " + flag1);
        
        if(!digital.getDigital(button))
        {
            if(flag1)
            {
                flag1 = false;
                //System.out.println("$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ RETURNING TRUE $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$");
                return true;
            }
        }
        else
        {
            flag1 = true;
        }

    } 
    catch (EnhancedIOException ex) 
    {
        System.out.println("FAILED");
        ex.printStackTrace();
    }
    return false;
}
 
开发者ID:DevilTech,项目名称:UltimateAscentCode,代码行数:30,代码来源:JoystickButton.java

示例13: holdButtonTimeDigital

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
public boolean holdButtonTimeDigital(double pauseTime)
{
    try {
        double curTime = 0.0;
        if(!digital.getDigital(button))
        {
            if(flag2)
            {
                flag2 = false;
                curTime = time.get();
            }
            else if(time.get() > curTime + pauseTime)
            {
                return true;
            }
        }
        else
        {
            time.stop();
            time.reset();
            flag2 = true;
        }
        
    } catch (EnhancedIOException ex) {
        ex.printStackTrace();
    }
    return false;
}
 
开发者ID:DevilTech,项目名称:UltimateAscentCode,代码行数:29,代码来源:JoystickButton.java

示例14: getDriveQuickTurn

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
public boolean getDriveQuickTurn() throws EnhancedIOException {
    return getIODigital(3);
}
 
开发者ID:johnzzhang,项目名称:Nutrons2013,代码行数:4,代码来源:OI.java

示例15: execute

import edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException; //导入依赖的package包/类
protected void execute() {
    try {
        dt.driveCheesy(oi.getDriveThrottle(), oi.getDriveWheel(), oi.getDriveQuickTurn());
    } catch (EnhancedIOException ex) {
    }
}
 
开发者ID:johnzzhang,项目名称:Nutrons2013,代码行数:7,代码来源:DTManualCheesyCmd.java


注:本文中的edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。