Advertisement
crackanddie

Move right for 10 seconds Robocad

Aug 16th, 2023
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. public class Main {
  2.     public static void main(String[] args) throws InterruptedException {
  3.         RobocadVMXTitan robot = new RobocadVMXTitan(false);
  4.  
  5.         long startTime = System.currentTimeMillis();
  6.         // едет 10 секунд назад
  7.         while (System.currentTimeMillis() - startTime < 10000){
  8.             robot.setMotorSpeed0(30);
  9.             robot.setMotorSpeed1(30);
  10.             robot.setMotorSpeed2(-60);
  11.         }
  12.  
  13.         robot.setMotorSpeed0(0);
  14.         robot.setMotorSpeed1(0);
  15.         robot.setMotorSpeed2(0);
  16.  
  17.         Thread.sleep(100);
  18.         robot.stop();
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement