Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. import lejos.hardware.ev3.LocalEV3;
  2. import lejos.hardware.motor.EV3LargeRegulatedMotor;
  3.  
  4. public class Laucher {
  5.  
  6. public static final EV3LargeRegulatedMotor latchMotor = new EV3LargeRegulatedMotor(LocalEV3.get().getPort("D"));
  7.  
  8. public static final EV3LargeRegulatedMotor reelMotor = new EV3LargeRegulatedMotor(LocalEV3.get().getPort("A"));
  9.  
  10.  
  11. public void launch() {
  12.  
  13. reelMotor.setAcceleration(100);
  14. latchMotor.setAcceleration(100);
  15. latchMotor.setSpeed(100);
  16.  
  17. //latch should begin unlocked
  18. //latchMotor.rotate(90); // unlock latch, rotate cw 90 deg from top view
  19. reelMotor.rotate(180); // wind the rope
  20.  
  21. latchMotor.rotate(-90); // lock the latch
  22. latchMotor.stop(); // keep the latch in place (resist spring)
  23.  
  24. reelMotor.rotate(-180); //unwind the rope
  25.  
  26. latchMotor.setAcceleration(500);
  27. latchMotor.setSpeed(500);
  28.  
  29. latchMotor.rotate(90); //unlock latch
  30. }
  31.  
  32. public static void main(String[] args) {
  33.  
  34.  
  35. }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement