VADCFLL-L Archives

First Lego League in Virginia and DC

VADCFLL-L@LISTSERV.JMU.EDU

Options: Use Classic View

Use Proportional Font
Show HTML Part by Default
Show All Mail Headers

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

Print Reply
Ralph Grove <[log in to unmask]>
Wed, 24 Oct 2012 08:33:59 -0400
text/plain (1294 bytes) , text/html (5 kB)
A basic problem with the program is that a single motor is being 
controlled by two different threads. Threads should do different things. 
For example you might have threads that play music, operate an arm, and 
operate drive motors simultaneously. Two NXT threads should not control 
the same sensor, motor, or output, however. Cooperative concurrency 
(where threads share resources) is the hardest part of parallel 
programming, and Mindstorms NXT really isn't suitable for this degree of 
complexity.

Here's a good tutorial on using threads for anyone who's interested: 
http://www.nxt-tutorial.stemcentric.com/Threading.html

Ralph

On 10/23/12 9:11 PM, Bob and Ann Henshaw wrote:
>
> Here is a simple program where the robot moves, stops on a line, 
> executes a 2 motor 90 degree spin, and moves forward. At the end, it 
> suddenly lurches to the right, despite the stop block.
>
> Thanks for looking at it!
>
> Bob
>
>
...

-- 
Ralph F Grove, Ph.D.
Professor
James Madison University Department of Computer Science


-- 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