Rotate in negative degrees

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

Moderators: 99jonathan, roger, imaqine

Rotate in negative degrees

Postby Shadowstep » Sun Jan 15, 2012 9:27 pm

Hay I have a program I'm writing and I am using some kind of loop and in that loop an If statement.
so my has a head on a motor so it has to constantly look left and right. What I do is I say rotate 15 degrees and so it looks left but then how do I get it to rotate back in the direction it came from?


thanx
Shadowstep
New User
 
Posts: 22
Joined: Sun Jan 15, 2012 9:24 pm

Re: Rotate in negative degrees

Postby Aswin » Sun Jan 15, 2012 10:55 pm

Hi,

You use the tachometer from the motor to do this. You can set a target, rotate to the target, then set another target (your starting position) and then rotate back. You'll find the exact commands explained in this tutorial.
My NXT blog: http://nxttime.wordpress.com/
Aswin
leJOS Team Member
 
Posts: 207
Joined: Tue Apr 26, 2011 9:18 pm
Location: Netherlands

Re: Rotate in negative degrees

Postby Shadowstep » Tue Jan 17, 2012 8:13 am

I don't really get the meaning of this. a tacho meter checks how fast it goes not? and 720 tacho = 720 rounds? or 720 degrees?

thanx
Shadowstep
New User
 
Posts: 22
Joined: Sun Jan 15, 2012 9:24 pm

Re: Rotate in negative degrees

Postby skoehler » Tue Jan 17, 2012 9:33 am

Shadowstep wrote:I don't really get the meaning of this. a tacho meter checks how fast it goes not? and 720 tacho = 720 rounds? or 720 degrees?


No. The Tachometer is a counter in this case. It counts, how far the motors have rotated. Movement in the one direction is positive, in the other direction it is negative. A tachocount of 720 means, that the motor has rotated 720 degrees.
skoehler
leJOS Team Member
 
Posts: 1458
Joined: Thu Oct 30, 2008 4:54 pm

Re: Rotate in negative degrees

Postby Shadowstep » Wed Jan 18, 2012 9:17 am

Ok thanx a lot I will look in to that tonight and let's pray it works now :p
:D
Shadowstep
New User
 
Posts: 22
Joined: Sun Jan 15, 2012 9:24 pm

Re: Rotate in negative degrees

Postby roger » Wed Jan 18, 2012 8:49 pm

Hi Shadowstep,
I understand why you were confused. Lego calls the sensor in the motor a tachometer, but your are correct that definition of a tachometer is an instrument that measures speed of rotation. It might better be called an odometer (in English), because it measures distance, not speed. But we are stuck with the Lego term. BTW, does anyone know what Lego called it in Danish?
Roger
roger
Moderator
 
Posts: 368
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Re: Rotate in negative degrees

Postby bullestock » Thu Jan 19, 2012 6:56 pm

roger wrote:Hi Shadowstep,
I understand why you were confused. Lego calls the sensor in the motor a tachometer, but your are correct that definition of a tachometer is an instrument that measures speed of rotation. It might better be called an odometer (in English), because it measures distance, not speed. But we are stuck with the Lego term. BTW, does anyone know what Lego called it in Danish?
Roger

AFAIK, it does not have a Danish name. LEGO does not sell a Danish version of the NXT.
bullestock
New User
 
Posts: 14
Joined: Fri Mar 04, 2011 9:52 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff