This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!

MoveSet class

By: jcdj1996 on Feb 7th, 2013  |  syntax: Java  |  size: 0.61 KB  |  views: 28  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package com.jcdj1996.final03;
  2. public class MoveSet {
  3.         Robot r1 = new Robot();
  4.         public boolean f8 = false;
  5.         public void figure8(){
  6.                 f8=true;        //is figure 8 occurring?
  7.                 try{
  8.                         r1.setSpeed(-720);      //first straight away
  9.                         Thread.sleep(1500);
  10.                         r1.turn(-12);   //turn all the way to the left
  11.                         Thread.sleep(6000);
  12.                         r1.turn(0);     //straighten out
  13.                         Thread.sleep(1000);     //straight away
  14.                         r1.turn(12);    //turn right
  15.                         Thread.sleep(6000);
  16.                         r1.turn(0);     //Straighten out again
  17.                         r1.setSpeed(0); //stop motion
  18.                 }catch(Exception e)
  19.                 {
  20.                         System.out.println(e);
  21.                 }
  22.                 f8=false;       //is figure 8 occurring?
  23.         }
  24.  
  25. }
clone this paste RAW Paste Data