Tutorials on Programing the with LEJOS

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

Tutorials on Programing the with LEJOS

Postby Dalek_Slayer » Mon Jan 27, 2014 11:13 pm

Is there a good tutorial out there on what the different ev3classes are for and how to use them? Cause I can program some java and know how to call up a class and use the methods in them. But these are a a bit trickyer to figure out.
Any help would be appreciated.
User avatar
Dalek_Slayer
Novice
 
Posts: 41
Joined: Sat Jan 25, 2014 11:42 pm
Location: Iowa

Re: Tutorials on Programing the with LEJOS

Postby lawrie » Tue Jan 28, 2014 3:10 pm

There is currently only the Wiki - http://sourceforge.net/p/lejos/wiki/Home/.

We will probably do a tutorial when the leJOS API is stable, but we are still changing it at the moment.

If there is some area you particularly want help with, let us know, as it is quite quick to add new Wiki entries.
lawrie
leJOS Team Member
 
Posts: 921
Joined: Mon Feb 05, 2007 1:27 pm

Re: Tutorials on Programing the with LEJOS

Postby Dalek_Slayer » Tue Jan 28, 2014 3:39 pm

I guess the current part that I'm haveing truble with is using the motors and sensors.
User avatar
Dalek_Slayer
Novice
 
Posts: 41
Joined: Sat Jan 25, 2014 11:42 pm
Location: Iowa

Re: Tutorials on Programing the with LEJOS

Postby lawrie » Fri Feb 07, 2014 9:49 pm

I have added a Wiki entry on motors - https://sourceforge.net/p/lejos/wiki/Motors/.

The Sensor framework entry gives some examples on use of sensors.
lawrie
leJOS Team Member
 
Posts: 921
Joined: Mon Feb 05, 2007 1:27 pm

Re: Tutorials on Programing the with LEJOS

Postby Dalek_Slayer » Fri Feb 07, 2014 11:02 pm

thanks
User avatar
Dalek_Slayer
Novice
 
Posts: 41
Joined: Sat Jan 25, 2014 11:42 pm
Location: Iowa

Re: Tutorials on Programing the with LEJOS

Postby Dalek_Slayer » Sat Feb 08, 2014 10:11 pm

The wiki artical that you wrote explained evey thing, but the ev3classes does not contain a EV3LargeRegulatedMotor or and EV3MediumRegulatedMotor. Also in the line of code:
Code: Select all
RegulatedMotor motor = new NXTRegulatedMotor(MotorPort.A);


eclipse says that there is a resource leak on "motor" and there is not a command to close it either.
User avatar
Dalek_Slayer
Novice
 
Posts: 41
Joined: Sat Jan 25, 2014 11:42 pm
Location: Iowa

Re: Tutorials on Programing the with LEJOS

Postby gloomyandy » Sun Feb 09, 2014 9:01 am

Hi,
thanks for the bug report. At the moment things are still changing pretty fast, so if you hit a problem it is always worth taking a look at the latest version of things (in git master), if you do you will find that the motor code has been changed a lot and that there is now a close method in BaseRegulatedMotor (which is used as the base class for all standard regulated motors):
https://sourceforge.net/p/lejos/ev3/ci/ ... r.java#l92

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Tutorials on Programing the with LEJOS

Postby Dalek_Slayer » Sun Feb 09, 2014 11:18 pm

Thanks that helped me find what I needed. but now I have run into a compiling error.
Code: Select all
clean:
   [delete] Deleting directory /home/Caleb/workspace/Testing/build
compile:
    [mkdir] Created dir: /home/Caleb/workspace/Testing/build
    [javac] /home/Caleb/workspace/Testing/build.xml:24: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to /home/Caleb/workspace/Testing/build
    [javac] /home/Caleb/workspace/Testing/src/testingMotors/MotorTest1.java:3: error: cannot find symbol
    [javac] import lejos.hardware.motor.BaseRegulatedMotor;
    [javac]                            ^
    [javac]   symbol:   class BaseRegulatedMotor
    [javac]   location: package lejos.hardware.motor
    [javac] /home/Caleb/workspace/Testing/src/testingMotors/MotorTest1.java:4: error: cannot find symbol
    [javac] import lejos.hardware.motor.EV3LargeRegulatedMotor;
    [javac]                            ^
    [javac]   symbol:   class EV3LargeRegulatedMotor
    [javac]   location: package lejos.hardware.motor
    [javac] /home/Caleb/workspace/Testing/src/testingMotors/MotorTest1.java:9: error: cannot find symbol
    [javac]       BaseRegulatedMotor motor = new EV3LargeRegulatedMotor (MotorPort.A);
    [javac]       ^
    [javac]   symbol:   class BaseRegulatedMotor
    [javac]   location: class MotorTest1
    [javac] /home/Caleb/workspace/Testing/src/testingMotors/MotorTest1.java:9: error: cannot find symbol
    [javac]       BaseRegulatedMotor motor = new EV3LargeRegulatedMotor (MotorPort.A);
    [javac]                                      ^
    [javac]   symbol:   class EV3LargeRegulatedMotor
    [javac]   location: class MotorTest1
    [javac] 4 errors


the program that I'm trying to run is simply to move a motor and looks like this
Code: Select all
package testingMotors;

import lejos.hardware.motor.BaseRegulatedMotor;
import lejos.hardware.motor.EV3LargeRegulatedMotor;
import lejos.hardware.port.MotorPort;

public class MotorTest1 {
   public static void main(String[] args) {
      BaseRegulatedMotor motor = new EV3LargeRegulatedMotor (MotorPort.A);
      
      motor.rotate (660);
      
      motor.close();
      

   }
}


what I am wondering is what does it mean by can't find symbol and how can I fix it or is it a bug.

thanks
User avatar
Dalek_Slayer
Novice
 
Posts: 41
Joined: Sat Jan 25, 2014 11:42 pm
Location: Iowa

Re: Tutorials on Programing the with LEJOS

Postby gloomyandy » Sun Feb 09, 2014 11:31 pm

Hi,
I'm not sure what it is you are doing but it looks like you are trying to use some of the files from the git master. This is almost certainly not a good thing to do unless you really know what it is you are doing. You can't use those files with the current 0.5.0-alpha sd card image. My previous comments were intended to point out that the problem you had reported has been fixed and that the fix will be in the next release. The lack of the close on the 0.5.0-alpha build is not serious and you can almost certainly ignore it.

The EV3LargeMotor class and others are not yet available for general use. The Wiki and API docs are a little ahead of the current release. We are working to create a new release and that should be available shortly.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4004
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Tutorials on Programing the with LEJOS

Postby Dalek_Slayer » Sun Feb 09, 2014 11:35 pm

ok that makes sense thank you for clearing that up
User avatar
Dalek_Slayer
Novice
 
Posts: 41
Joined: Sat Jan 25, 2014 11:42 pm
Location: Iowa

Re: Tutorials on Programing the with LEJOS

Postby wiso » Wed Mar 12, 2014 4:30 pm

Hi,
I followed the instructions of http://sourceforge.net/p/lejos/wiki/Dev ... h%20leJOS/
When I built the DbusJava and ev3classes I tried to built EV3FirstProgram but the first error was:
BUILD FAILED
Target "dist" does not exist in the project "EV3FirstProgram".

What can I do?
Thanks.
wiso
New User
 
Posts: 7
Joined: Fri Nov 29, 2013 11:05 am

Re: Tutorials on Programing the with LEJOS

Postby Dalek_Slayer » Wed Mar 12, 2014 11:09 pm

Hi

What is the exact error that you are getting. Because the simptomse sound like an error that I got when I was first setting the brick up.
User avatar
Dalek_Slayer
Novice
 
Posts: 41
Joined: Sat Jan 25, 2014 11:42 pm
Location: Iowa

Re: Tutorials on Programing the with LEJOS

Postby lawrie » Thu Mar 13, 2014 10:22 am

Hi wiso,

You must have an error in your build.xml file. Did you copy and paste it?

It is trying to find an ant target called "dist" and there is no such target in the build.xml file in the Wiki.

The default target should be "copy" (that copies files to the EV3) and that depends on a target called "jar" (that builds the jar file). There is no "dist" target, so, as I say, you must have a typing error somewhere in build.xml.
lawrie
leJOS Team Member
 
Posts: 921
Joined: Mon Feb 05, 2007 1:27 pm


Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff