Simple question on motor rotation

This is where you talk about the NXJ hardware related topics such as the brick, sensors, LEGO pieces, etc.

Moderators: imaqine, 99jonathan, roger

New User
Posts: 11
Joined: Tue Nov 29, 2011 8:27 am

Simple question on motor rotation

Postby Mariam » Tue Jun 17, 2014 11:07 am


I am trying to rotate to rotate my NXT motor for 90 degree, so I wrote simple code :

Code: Select all

import lejos.nxt.*;

import lejos.robotics.RegulatedMotor;
public class program {

public static void main(String[] args) {


My motor rotates 360 degrees for 9 times, its the same when U change the degree to different angles. I tried on different motors. I am not sure whats wrong.

I run on leJOS 0.9.0 and windows 7.

Thank you.

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

Re: Simple question on motor rotation

Postby gloomyandy » Tue Jun 17, 2014 6:53 pm

That is very strange, are you running that code on the NXT, or on a PC? What sort of motor do you have attached to port B? What happens if you add the following to the end of your program (after the rotate command) Delay.msDelay(10000);

Also you should probably update to the latest version of leJOS for the NXT.

Return to “NXJ Hardware”

Who is online

Users browsing this forum: No registered users and 1 guest