Using Motors crashes my EV3

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

Moderators: roger, gloomyandy, skoehler

Using Motors crashes my EV3

Postby KayelGee » Wed Jan 15, 2014 8:21 pm

I'm not able to use motors. Once I call forward or rotate the whole EV3 freezes and I can't even connect via ssh anymore.
I've written a small test program which freezes once I press any button after I reach "start".
I'm using 0.5.0. Motors are working in the default EV3 software.

Am I doing something wrong? Is there a way I can get more information about the freeze?

Code: Select all
 
static EV3LargeRegulatedMotor leftMotor;
   public static void main(String[] args) {
      LCD.clear();
      LCD.drawString("ready", 0, 5);
      LCD.refresh();
      Button.waitForAnyPress();
      LCD.clear();
      LCD.drawString("motor", 0, 5);
      LCD.refresh();
      Button.waitForAnyPress();
      leftMotor = new EV3LargeRegulatedMotor(MotorPort.C);
      LCD.clear();
      LCD.drawString("tacho", 0, 5);
      LCD.refresh();
      Button.waitForAnyPress();
      leftMotor.resetTachoCount();
      LCD.clear();
      LCD.drawString("speed", 0, 5);
      LCD.refresh();
      Button.waitForAnyPress();
      leftMotor.setSpeed(400);
      LCD.clear();
      LCD.drawString("accel", 0, 5);
      LCD.refresh();
      Button.waitForAnyPress();
       leftMotor.setAcceleration(800);
       LCD.clear();
      LCD.drawString("start", 0, 5);
      LCD.refresh();
      Button.waitForAnyPress();
       leftMotor.forward();
       LCD.clear();
      LCD.drawString("anykey to end", 0, 5);
      LCD.refresh();
       Button.waitForAnyPress();
}
KayelGee
New User
 
Posts: 2
Joined: Wed Jan 15, 2014 8:00 pm

Re: Using Motors crashes my EV3

Postby Aswin » Wed Jan 15, 2014 8:53 pm

Hi,

It could be possible that you are running a version of leJOS that is more recent than 0.5.0-alpha. You could try to instruct Git to this release by issuing the following command:
git checkout tags/<tag_name>
My NXT blog: http://nxttime.wordpress.com/
Aswin
leJOS Team Member
 
Posts: 187
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: Using Motors crashes my EV3

Postby gloomyandy » Wed Jan 15, 2014 8:57 pm

That code is using the current git master not 0.5.0-alpha (the EV3LargeRegulatedMotor did not exist in 0.5.0. What you are using is a new version of the motor control classes that is not compatible with the 0.5.0 SD card image. It is not a good idea to do this unless you really understand what you are doing.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3642
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Using Motors crashes my EV3

Postby KayelGee » Sat Jan 18, 2014 10:25 am

You are right I've been using the master branch. I can't seem to find a way to choose a tag in eclipse while importing the git repo. I went on sourceforge and downloaded the 0.5.0 version from there and now it works thanks.
KayelGee
New User
 
Posts: 2
Joined: Wed Jan 15, 2014 8:00 pm


Return to EV3 Software

Who is online

Users browsing this forum: Williambes and 1 guest

more stuff