Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import lejos.hardware.ev3.LocalEV3;
- import lejos.hardware.motor.EV3LargeRegulatedMotor;
- public class Laucher {
- public static final EV3LargeRegulatedMotor latchMotor = new EV3LargeRegulatedMotor(LocalEV3.get().getPort("D"));
- public static final EV3LargeRegulatedMotor reelMotor = new EV3LargeRegulatedMotor(LocalEV3.get().getPort("A"));
- public void launch() {
- reelMotor.setAcceleration(100);
- latchMotor.setAcceleration(100);
- latchMotor.setSpeed(100);
- //latch should begin unlocked
- //latchMotor.rotate(90); // unlock latch, rotate cw 90 deg from top view
- reelMotor.rotate(180); // wind the rope
- latchMotor.rotate(-90); // lock the latch
- latchMotor.stop(); // keep the latch in place (resist spring)
- reelMotor.rotate(-180); //unwind the rope
- latchMotor.setAcceleration(500);
- latchMotor.setSpeed(500);
- latchMotor.rotate(90); //unlock latch
- }
- public static void main(String[] args) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement