|
Re: Pnuematics Programming Issues
Quote:
Originally Posted by captianjroot
Code:
//this is all within our main robot class
Compressor compress;
public void robotInit(){
compress=new Compressor(1,1);
}
public void operatorControl() {
while(isOperatorControl()&&isEnabled()){
if(!compress.enabled())
{
compress.start();
}
}
}
|
This is of course assuming that the compressor is connected to a spike that is connected to relay channel 1 (on the first digital sidecar if you have more than one) and that the pressure switch is connected to digital input #1 on the same digital sidecar. Also note that you don't really need the 'enabled' clause, you can continually 'start' the compressor. It doesn't hurt anything.
This will only start the compressor in teleop.
__________________
Floyd Moore
Mentor Electrical and Pneumatics
Team 997 - Spartan Robotics
Corvallis High School, Corvallis Oregon
|