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 

Here's a good tutorial on using threads for anyone who's interested: 


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