VADCFLL-L Archives

First Lego League in Virginia and DC

VADCFLL-L@LISTSERV.JMU.EDU

Options: Use Forum View

Use Monospaced Font
Show HTML Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Content-Type:
multipart/alternative; boundary="----=_NextPart_000_00AE_01CC975B.72B73850"
Sender:
First Lego League in Virginia and DC <[log in to unmask]>
Subject:
From:
Stuart & Lori Roll <[log in to unmask]>
Date:
Sun, 30 Oct 2011 23:27:10 -0400
In-Reply-To:
MIME-Version:
1.0
Reply-To:
Stuart & Lori Roll <[log in to unmask]>
Parts/Attachments:
text/plain (4 kB) , text/html (7 kB)
Mandy -

I just did a quick programming test to double-check my recollections on this matter, so I think I have this right.

First, I should say that the Reset Motor block is very esoteric and probably not what you meant to use.

If you are using a Rotation Sensor block with the action set to “reset” then it should reset the rotation sensor for that motor to zero (it always starts at zero when the program starts).  To test this, you can use a Rotation Sensor in “read” mode and use data wires to feed the value into a Number to Text block and then into a Display block set to display text, followed by a Wait block set to wait for the NXT “enter” button to be pressed (this makes a handy My Block by the way).  A common error is for the Rotation Sensor block to reset the wrong motor or for it to not be set to “reset”, so a cursory check for simple bugs is always useful.

That said, you should not have to reset the rotation sensor for most basic movement.  If you use a Motor block with a duration of “rotations” or “degrees” then the motor will move that many rotations or degrees more each time, regardless of the previous value of the rotation sensor.  To test this, write a program with the display-and-wait I mentioned above like this:  display and wait, Motor forward 360 degrees, display and wait, Motor forward 360 degrees, display and wait.  You will see “0” displayed to start, then the motor will move one rotation and you will see “360”, then the motor will move one more rotation and you will see “720” displayed.  Using a Move block that includes that motor in place of the Motor blocks will get you approximately the same result.

Generally the only time you will need to reset the rotation counter is if you are comparing the value to a specific number.  For example:  reset rotation sensor, Motor forward unlimited, wait for rotation sensor to be > 360, Motor stop.  If you don’t reset the rotation sensor that code snippet will behave differently depending on what earlier blocks have done.  You can see why using the Motor and Move blocks are usually the right way to go.

If you are using Move and Motor blocks and you are still having problems, send me a copy of your program directly and I can look at it for you (the mailing list won’t accept attachments).

Stuart





From: Mandy Wilson 
Sent: Sunday, October 30, 2011 10:35 PM
To: [log in to unmask] 
Subject: [VADCFLL-L] Bluetooth and reset sensors

We just installed a Bluetooth and it is wonderful.  We bought a Windows 7 compatible dongle (http://www.amazon.com/gp/product/B004LNXO28/ref=oh_o00_s00_i00_details) for less than $20 and it works with no connection problems to the NXT.  My team has become fascinated with reading the sensors via Bluetooth while the robot is roaming and have discovered that none of their reset rotation sensors or reset motor blocks seem to be resetting anything.  They put these before the wild turns and the turns still are wild.  On these turns, the robot behaves for a time or two, goes on a wild turn  for a time or two and then go back to behaving for a time or two.  However the team has noticed that when they reset the turns manually via the Bluetooth at the start of the program, then all of the turns behave fine.  Has anyone else experienced this?  Is there a correct way to resetting rotation sensors and motor blocks other than just dumping then in front of a turn?  How can they reset the turns without manually going through the Bluetooth each time?

 

Thanks for any help that anyone can offer!

 

Mandy Wilson


--------------------------------------------------------------------------------
To UNSUBSCRIBE or CHANGE your settings, please visit https://listserv.jmu.edu/archives/vadcfll-l.html and select "Join or leave the list". 
VADCFLL administrative announcements are sent via VADCFLL-ANNOUNCEMENTS-L. Visit https://listserv.jmu.edu/archives/vadcfll-announcements-l.html to subscribe.

-- To UNSUBSCRIBE or CHANGE your settings, please visit https://listserv.jmu.edu/archives/vadcfll-l.html and select "Join or leave the list".

-- VADCFLL administrative announcements are sent via VADCFLL-ANNOUNCEMENTS-L. Visit https://listserv.jmu.edu/archives/vadcfll-ANNOUNCEMENTS-l.html to subscribe.

ATOM RSS1 RSS2