Quoting [EMAIL PROTECTED]:
Hi Bindiya.
you wrote:
> I modified the program but it still doesnt work:
>
> import lejos.nxt.*;
> import lejos.subsumption.*;
> import lejos.navigation.*;
> public class FollowWall
> {
> static final int TOTALTIME = 60000;
>
> public static void main(String[] args) throws Exception {
> UltrasonicSensor sonic = new UltrasonicSensor(SensorPort.S2);
> int startTime = (int)System.currentTimeMillis();
> int totalTime = 0;
>
> while(totalTime < TOTALTIME) {
> if(sonic.getDistance() > 20)
> Motor.B.rotate(10,true);
> else
> {
> Motor.B.forward();
> Motor.C.forward();
> }
> totalTime = (int)System.currentTimeMillis() - startTime;
> }
My guess is that your robot keeps moving in a straight line, no matter
how close or far from the wall. Is that what it does?
The code seems to cause both motors to rotate forward at the same speed
all the time. Do you agree?
Roger
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Lejos-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lejos-discussion