Reader Question Submission #4
Jean-Marc emailed: "Hi, I am just starting out programming the NXT robot. I want to use one as a master with levers which will control the movement of the slave. I will use the motor as a rotation sensor in the master, but I'm not powering on the motor (it's to attempt to duplicate Steve's "omni"). Here is my question: When I start out with the lever in the straight up position, what numeric reading will the rotation sensor give me? If I want to move the lever forward and backward in a range of approximately 180 degrees, what is the reading of the "up" or neutral position? Thanks for your help!"
Any thoughts or answers?
Any thoughts or answers?
Comments
The rotation reading will be 0 when you first start the program no matter where the lever is. So just put the lever upright before starting the program.
I'm not sure how your master bot is set up, but you can find out how many rotations the lever has turned at any time by the "view" section on the NXT. Just go to "motor rotations", and it will show you how much rotations the motor has turned at all times.
-Jonathan
nicthegr
Jim
Huh, I thought I had posted more detailed stuff on that. I've used remote control for my dual-NXT projects, and actually popped some of the code into my LEGO MDP profile page. The other place to look is in my Brickshelf folder: look at the screenshots "btrc" and "remote":
http://www.brickshelf.com/cgi-bin/gallery.cgi?i=1891684
http://www.brickshelf.com/cgi-bin/gallery.cgi?i=1891688
Note that I didn't like the position & direction as seperate things... so I wrote a MyBlock to roll them into one (signed) value. Are these screenshots enough?
--
Brian Davis
Is there some explanation somewhere about the "mux/demux of the switch"? I has a hard time figuring how to wire your GetAngle block (tried to wire directly add/substract inside switch to input of next block -> grey invalid wire!)
Philo
http://www.brickshelf.com/cgi-bin/gallery.cgi?i=2029011
The trick (I think) is that the two wires coming out need to connect to the same wire *at* the boundry of the Switch, *not* at the downstream plug. Even then, it seems to be... tricky, to get it the first time.
--
Brian Davis