View Single Post
  #4   Spotlight this post!  
Unread 04-02-2012, 23:31
Biolore Biolore is offline
Lead Programmer
AKA: Josh
FRC #3597 (Robo-Rangers)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Kittery, Maine
Posts: 68
Biolore is infamous around these partsBiolore is infamous around these parts
Re: Wiring the photosensors (Rockwell)

Well, I think we tried that. that may mean that the problem lays in the programming.

Usining java, you get to them with the DigitalInput class, right?

can someone tell me if this looks right for making a command be executed whenever three cameras are set off?


DigitalInput camera1, camera2, camera3;
InternalButton button1;

public OI(){
camera1 = new DigitalInput(1);
camera2 = new DigitalInput(2);
camera3 = new DigitalInput(3);

boolean C1 = camera1.get();
boolean C2 = camera2.get();
boolean C3 = camera3.get();

if (C1 && C2 && C3){
button1.setPressed(true);
} else {
button1.setPressed(false);
}
button1.whenPressed(new ThreeCameras());
}