Lynk Library of Knowledge

9496 Lynk's site for housing knowledge and information for the team.


Project maintained by LynkRobotics Hosted on GitHub Pages — Theme by Jimmy McCosker

Creating and using objects







Example


motor m1 = new motor(0);              //new is used to create an instance of the class called an object
      motor m2 = new motor(1);
      
      System.out.println("m1 channel: " + m1.getChannel());
      System.out.println("m2 channel: " + m2.getChannel());
      
      m1.setSpeed(1);
      m2.setSpeed(-1);

      System.out.println("m1 speed: " + m1.getSpeed());
      System.out.println("m2 speed: " + m2.getSpeed());


Previous Page / Home / Next Page