If you have a rotation sensor you could have it count the distance for you.
I'll be receiving a speedcomputer (5206) shortly and hope to find out if I can use it as a rotation sensor. I've also read (but not yet succesfully tried) that the fiber optics element (part #6637) can be used a a rotation sensor.

Linmix

Saptarshi Purkayastha wrote:

I have created a robot on differential drive which is connected with a bumper mechanism using the touch sensor. I want to create a program that measures distances between walls of the room.

I know the robot can travel 1m distance in 2secs. But now what I want to do is, when the bumper is pressed(robot hits the wall) the robot should stop moving forward and display the distance travelled on the LCD. I've tried using System.currentTimeMillis(), but since leJOS doesnt support "long" datatypes, Im unable to use it and find the time for which it travelled before hitting the wall. I cant find anything useful in the TimingNavigator class that can give me distance travelled by robot.

Please provide some solution on how can this be done. Please reply quickly as this is an urgent requirement.

--
Regards,
Saptarshi PURKAYASTHA

You Live by CHOICE, Not by CHANCE



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Lejos-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lejos-discussion

Reply via email to