View Single Post
  #2   Spotlight this post!  
Unread 04-02-2016, 21:45
rpappa rpappa is offline
Registered User
FRC #0340
 
Join Date: Feb 2016
Location: Rochester
Posts: 9
rpappa is an unknown quantity at this point
Re: Problems with Encoders

IDK if you're using iterative robot or command base but essentially:

Code:
private int start;

public void initialize() {
	start = encoder.get();
	motor.set(speed);
}

public void loop() { //this would be execute in a command not sure in iterative
	if(encoder.get()-start > 500) {
		motor.set(0);
	}
}
Not tested not even written in an IDE so take it with a grain of salt
Reply With Quote