本文整理汇总了Java中edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java EnhancedIOException.printStackTrace方法的具体用法?Java EnhancedIOException.printStackTrace怎么用?Java EnhancedIOException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.wpi.first.wpilibj.DriverStationEnhancedIO.EnhancedIOException
的用法示例。
在下文中一共展示了EnhancedIOException.printStackTrace方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
示例2: 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();
}
}
示例3: 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();
}
}
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}