motors don't turn

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

Moderators: roger, gloomyandy, skoehler

gymbuntu
New User
Posts: 4
Joined: Sun Feb 09, 2014 2:29 pm

motors don't turn

Postby gymbuntu » Sun Feb 09, 2014 5:28 pm

Hi forum,
I am new and this is my problem:

I got an ev3 and I want to use lejos on it.
I set up eclipse, downloaded the sd-card image,
connected the ev3 and loaded the first hello world.
Fine. it worked!

Then I read the wiki for "motors" an wote the following Java code:

Code: Select all

import lejos.hardware.Button;
import lejos.hardware.lcd.LCD;
import lejos.hardware.motor.NXTMotor;
import lejos.hardware.port.MotorPort;
import lejos.robotics.EncoderMotor;
import lejos.utility.Delay;

public class EV3FirstProgram
{
   
      public static void main(String[] args)
   {
        LCD.clear();
        LCD.drawString("Motor test", 0, 5);
        Button.waitForAnyPress();
        LCD.clear();
        LCD.drawString("Motor A on", 0, 5);
        EncoderMotor em = new NXTMotor(MotorPort.A);
        em.setPower(100);
        em.forward();
        Delay.msDelay(2000);
        em.stop();
        LCD.clear();
        LCD.refresh();

    }

}


The program runs, I read the Message "Motor A on" but the motor does not turn at all.
(And yes, it is connected).

What do I do wrong?

Thanks for your help
Roland

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

Re: motors don't turn

Postby gloomyandy » Sun Feb 09, 2014 7:03 pm

Are you sure you are using the correct set of sources. Have you switched to use the 0.5.0-alpha tag. If you are using master then motor control may not work with the 0.5.0-alpha sd card.

wiso
New User
Posts: 9
Joined: Fri Nov 29, 2013 11:05 am

Re: motors don't turn

Postby wiso » Fri Sep 26, 2014 8:47 am

Hi.
I want to use de setPower function in my EV3, but I can not make it work. Can anyone write an example of how to call this function for move forward after?

Thanks.

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

Re: motors don't turn

Postby gloomyandy » Fri Sep 26, 2014 9:23 am

Post your code, tell us what you want it to do and what it actually does.

wiso
New User
Posts: 9
Joined: Fri Nov 29, 2013 11:05 am

Re: motors don't turn

Postby wiso » Fri Sep 26, 2014 9:32 am

I have calculated a value because I want to put it as SetPower and then move that motor. To use this function I want to access the BasicMotor library, but I can't do it

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

Re: motors don't turn

Postby gloomyandy » Fri Sep 26, 2014 10:41 am

I'm sorry I don't understand your question. Post the code you are trying to use and tell us what you expect it to do and what it actually does.


Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 2 guests