|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#1
|
||||
|
||||
|
What was the hardest to program this year in Java?
I was going around, and I know that people make classes/interfaces for doing the bizzare things that are used frequently on their robots.
For me is was getting DigitalInputs working, to do that, I made this class: Code:
package com.shadowh511.mayor.inputs;
import edu.wpi.first.wpilibj.DigitalInput;
public class Switch {
private DigitalInput source;
public Switch(int channel) {
this.source = new DigitalInput(4,channel);
}
public Switch(int slot, int channel) {
this.source = new DigitalInput(slot,channel);
}
public boolean oldGet() {
return this.source.get();
}
public boolean get() {
if(!this.source.get()) {
return true;
} else {
return false;
}
}
}
Code:
Switch ballSwitch = new Switch(4); Code:
Switch ballSwitch = new Switch(4,4); |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Java this year? | Mo_Shen | General Forum | 6 | 01-06-2010 10:52 AM |
| What is the hardest (yet possible) task in this year's game? | Wayne C. | General Forum | 88 | 01-16-2008 06:30 PM |
| What year was the hanging bar from? | Jeremy | General Forum | 3 | 01-11-2004 11:00 PM |
| What was your best memory from this year/ever? | miketwalker | General Forum | 30 | 05-01-2003 01:24 PM |
| What was the most innovative feature this year? | archiver | 2001 | 15 | 06-24-2002 04:17 AM |