slow movement

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

Moderators: 99jonathan, roger, imaqine

slow movement

Postby exite » Fri Apr 13, 2007 9:59 am

Hello!
Since the new alpha release my nxt has a slow movement..
Is maybe the battery empty? A helpful function 4 the next release could be a battery indicator...?
exite
New User
 
Posts: 10
Joined: Fri Feb 23, 2007 7:58 am

Postby exite » Fri Apr 13, 2007 4:59 pm

My programm code && 1 question

import lejos.nxt.*;
import lejos.navigation.*;
public class Linie
{
public static TachoNavigator nav = new TachoNavigator(5.5f,11.2f);
public static LightSensor light = new LightSensor(SensorPort.S2);


public static void main (String[] aArg)


throws Exception
{

Motor.A.regulateSpeed(true);
Motor.C.regulateSpeed(true);

Motor.A.setSpeed(600);
Motor.C.setSpeed(600);



Button.ENTER.waitForPressAndRelease();
String l = "Light:";
String p = "Press ENTER";

vor();
}

public static void rotierenLinks()
{
nav.rotate(2);
}
public static void rotierenRechts()
{
nav.rotate(-2);
}
public static void vor()
{
boolean status = true;
light.setFloodlight(true);



while (status == true )
{
nav.forward();
if (50 <= light.readValue())
{
nav.stop();
int x = 0;
while((41 <= light.readValue()) && (x<=10) )
{


rotierenLinks();
x++;

}

if(50 <= light.readValue() )
{
while (41 <= light.readValue())
{
rotierenRechts();
}

}

}
/* if (31 == light.readValue())
{
nav.stop();
status = false;
}

*/
}

}
}

As I used your old alpha, my while loop was ok but now with the new release my nxt is very slow with rotate..
How can I solve this problem?
In addition I true useless to create a timer object :( maybe you can show me an example?

--------------
Sorry 4 my bad English (German)
exite
New User
 
Posts: 10
Joined: Fri Feb 23, 2007 7:58 am

Postby bbagnall » Wed Apr 18, 2007 3:38 pm

You can increase the speed to something like 900 which I believe is full speed (it uses degrees per second to measure speed). We'll try to get a battery indicator in the next release.
User avatar
bbagnall
Site Admin
 
Posts: 392
Joined: Fri Aug 04, 2006 4:03 pm

Postby exite » Thu Apr 19, 2007 5:02 pm

No no the commands in the while loop are extremly slow.!
exite
New User
 
Posts: 10
Joined: Fri Feb 23, 2007 7:58 am

Postby exite » Thu Apr 19, 2007 5:03 pm

No no the commands in the while loop are extremly slow execute
(rotate(1)) :!:



In addition can you write a test programm with a timer?

The execution of commands is very slower as in the old alpha release!
exite
New User
 
Posts: 10
Joined: Fri Feb 23, 2007 7:58 am


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff