Update encoder.java
This commit is contained in:
parent
f66dbacc92
commit
a3b3c71d54
1 changed files with 2 additions and 2 deletions
|
@ -1,9 +1,9 @@
|
|||
DcMotor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER); // tare the encoder
|
||||
DcMotor.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
|
||||
DcMotor.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);// bloque le motor
|
||||
// Position droite = 8 ticks
|
||||
// position initiale = 0 ticks
|
||||
// position allongée = - 16 ticks
|
||||
// in opMode:
|
||||
int pos_to_go = ...; // position to go
|
||||
int pos_to_go = 8; // position to go
|
||||
DcMotor.setTargetPosition(pos_to_go); // set target position, the motor will run to this pos
|
||||
DcMotor.setMode(DcMotor.RunMode.RUN_TO_POSITION); // mode run to position
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue