Lejos freeze, can't use motors

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

Moderators: roger, gloomyandy, skoehler

Lejos freeze, can't use motors

Postby goroxto » Sat Feb 15, 2014 1:23 pm

Hello friends,
i've just played HelloWorld program well on my Ev3..now I tryied to play a simple motor movement but the Ev3 brick freezes! Can anybody help me?
The code is:

Code: Select all
import lejos.hardware.Button;
import lejos.hardware.Sound;
import lejos.hardware.ev3.LocalEV3;
import lejos.hardware.lcd.Font;
import lejos.hardware.lcd.GraphicsLCD;
import lejos.utility.Delay;
import lejos.hardware.lcd.LCD;
import lejos.hardware.motor.NXTRegulatedMotor;
import lejos.hardware.port.MotorPort;

public class ProvaAndrea
{
   private static NXTRegulatedMotor c;
   public static void main(String[] args)
    {
        LCD.clear();
        LCD.drawString("First EV3 Program", 0, 2);
        //Motor.A.setSpeed(720);
        //Motor.A.forward();
        //Button.waitForAnyPress();
        //Motor.A.stop();
        //LCD.clear();
       
        c = new NXTRegulatedMotor(MotorPort.A);
        c.forward();
        Button.waitForAnyPress();
        c.stop();
    }
}


(I also tryied to play the commented code too but the result is the same)

i have lejos 0.5.0-alpha on brick, on my eclipse i have API downloaded from git and with tag "lejos-ev3 0.6.0-alpha 308fe5e"...I also tryied 0.5.0-alpha tag but the result is the same..
where am I wrong?

thank you so much..
goroxto
New User
 
Posts: 8
Joined: Fri Feb 14, 2014 7:30 pm

Re: Lejos freeze, can't use motors

Postby tigger » Sat Feb 15, 2014 1:37 pm

I had the same problem when I started with Lejos: on the brick the SD.img in version 0.5.0 and using the latest version from EV3 sources via git.

In my case the "solution" was to use the same version for both on SD.img (drivers on the brick) and ev3classes (API to code my programs). The motor example described in Wiki runs with SD.img 0.6 only because the motor classes EV3LargeRegulatedMotor and EV3MediumRegulatedMotor are not part of the version 0.5.0, so there is no driver on the brick to understand the code => Brick freezes.

While using 0.5.0 version of leJOS there is an older Motor API without the EV3 motor classes. This works, but some people including me had freaky jitter effects using motors. With 0.6.0 came up this week the new Motor classes available in ev3clases, and the motor control is smooth and without jitter effects (in my experiments).

Be sure use the 0.6.0 version of leJOS on brick (Menu => Version), then the motors should work with the EV3*RegulatedMotor classes.

Regards,
Marco
tigger
New User
 
Posts: 17
Joined: Mon Feb 10, 2014 10:04 pm

Re: Lejos freeze, can't use motors

Postby goroxto » Sat Feb 15, 2014 2:56 pm

I will try, thank you Marco!
sei italiano?
goroxto
New User
 
Posts: 8
Joined: Fri Feb 14, 2014 7:30 pm

Re: Lejos freeze, can't use motors

Postby goroxto » Sat Feb 15, 2014 3:57 pm

I've tryied 0.6.0 sd image but doesn't boot...it freezes on Lejos logo with "Starting.."
goroxto
New User
 
Posts: 8
Joined: Fri Feb 14, 2014 7:30 pm

Re: Lejos freeze, can't use motors

Postby gloomyandy » Sat Feb 15, 2014 7:50 pm

How long are you waiting? The leJOS SD card image take a long time to boot on the first boot as it needs to unpack and install the JRE.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4042
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Lejos freeze, can't use motors

Postby epascual » Sun Feb 16, 2014 12:36 am

goroxto wrote:I've tryied 0.6.0 sd image but doesn't boot...it freezes on Lejos logo with "Starting.."
I got the same problem, but it was caused by a bad image copy on the SD (although no error were reported).

Re-doing the copy procedure solved the problem. Maybe you can try re-building your SD card.
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: Lejos freeze, can't use motors

Postby goroxto » Sun Feb 16, 2014 3:15 am

gloomyandy wrote:How long are you waiting? The leJOS SD card image take a long time to boot on the first boot as it needs to unpack and install the JRE.


After 20 or 30 minutes was freezed...i rebuilt the image on the sd and then worked!! ;)
thank you..!
goroxto
New User
 
Posts: 8
Joined: Fri Feb 14, 2014 7:30 pm

Re: Lejos freeze, can't use motors

Postby goroxto » Sun Feb 16, 2014 3:17 am

i'm becoming crazy..now I have this problem on running build.xml of my project..

Code: Select all
    [mkdir] Created dir: C:\Users\andre\workspace\ProveAndrea\build
    [javac] C:\Users\andre\workspace\ProveAndrea\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 C:\Users\andre\workspace\ProveAndrea\build
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:1: error: package lejos.hardware does not exist
    [javac] import lejos.hardware.Button;
    [javac]                      ^
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:2: error: package lejos.hardware does not exist
    [javac] import lejos.hardware.Sound;
    [javac]                      ^
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:3: error: package lejos.hardware.ev3 does not exist
    [javac] import lejos.hardware.ev3.LocalEV3;
    [javac]                          ^
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:4: error: package lejos.hardware.lcd does not exist
    [javac] import lejos.hardware.lcd.Font;
    [javac]                          ^
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:5: error: package lejos.hardware.lcd does not exist
    [javac] import lejos.hardware.lcd.GraphicsLCD;
    [javac]                          ^
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:6: error: package lejos.utility does not exist
    [javac] import lejos.utility.Delay;
    [javac]                     ^
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:7: error: package lejos.hardware.lcd does not exist
    [javac] import lejos.hardware.lcd.LCD;
    [javac]                          ^
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:8: error: package lejos.hardware.motor does not exist
    [javac] import lejos.hardware.motor.NXTRegulatedMotor;
    [javac]                            ^
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:9: error: package lejos.hardware.port does not exist
    [javac] import lejos.hardware.port.MotorPort;
    [javac]                           ^
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:13: error: cannot find symbol
    [javac]    private static NXTRegulatedMotor c;
    [javac]                   ^
    [javac]   symbol:   class NXTRegulatedMotor
    [javac]   location: class Hello
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:16: error: cannot find symbol
    [javac]         LCD.clear();
    [javac]         ^
    [javac]   symbol:   variable LCD
    [javac]   location: class Hello
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:17: error: cannot find symbol
    [javac]         LCD.drawString("First EV3 Program", 0, 2);
    [javac]         ^
    [javac]   symbol:   variable LCD
    [javac]   location: class Hello
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:24: error: cannot find symbol
    [javac]         c = new NXTRegulatedMotor(MotorPort.A);
    [javac]                 ^
    [javac]   symbol:   class NXTRegulatedMotor
    [javac]   location: class Hello
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:24: error: cannot find symbol
    [javac]         c = new NXTRegulatedMotor(MotorPort.A);
    [javac]                                   ^
    [javac]   symbol:   variable MotorPort
    [javac]   location: class Hello
    [javac] C:\Users\andre\workspace\ProveAndrea\src\Hello.java:26: error: cannot find symbol
    [javac]         Button.waitForAnyPress();
    [javac]         ^
    [javac]   symbol:   variable Button
    [javac]   location: class Hello
    [javac] 15 errors

goroxto
New User
 
Posts: 8
Joined: Fri Feb 14, 2014 7:30 pm

Re: Lejos freeze, can't use motors

Postby gloomyandy » Sun Feb 16, 2014 7:52 am

Please take a look at this thread:
viewtopic.php?f=18&t=5844
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4042
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Lejos freeze, can't use motors

Postby epascual » Sun Feb 16, 2014 10:09 am

goroxto wrote:After 20 or 30 minutes was freezed...i rebuilt the image on the sd and then worked!! ;)
thank you..!
Was exactly the same here. Glad it has helped you.
Eric PASCUAL - POBOT association VP & co-founder - http://www.pobot.org
epascual
Active User
 
Posts: 123
Joined: Sun Jan 17, 2010 12:15 am
Location: Sophia-Antipolis (France)

Re: Lejos freeze, can't use motors

Postby goroxto » Sun Feb 16, 2014 2:00 pm

So kind, thank you guys..all is working now! I hope to help someone as you have done with me!
goroxto
New User
 
Posts: 8
Joined: Fri Feb 14, 2014 7:30 pm


Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 4 guests

more stuff