Answers.Body: <p>In the middle "thead" all of your motor blocks are "unlimited" or "stop". These blocks change the motor state and immediately continue to the next block. These are inside a loop that loops forever, so these blocks are running continuously in the loop. The motor blocks in the top thread may have an effect for a split second until the middle thread loops again and changes what the motor is doing.</p>
  
  <p>I suggest writing to a variable in the top thread instead of using motor blocks. Then read from that variable in the middle thread. For example, you could use a numeric variable and give it a value of '1' for forwards and <code>-1</code> for reverse. Then in the middle thread, use a multiply math block to multiply the desired motor speed by the variable to change the direction.</p>
  
  <p>Or, for that matter, you could read the 4th touch sensor value in the middle thread and remove the top thread.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-02T21:34:29.113Z
Answers.Text: Thank you, will try the suggested approach and post update here.
Answers.UserDisplayName: Konstantin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-03T00:41:13.927Z
Answers.Text: wouldn't the motor blocks in the middle thread only "activate" when 1st touch sensor is pressed? Eg. middle thread kicks in when 1st button is pressed, and then checks if 2nd button is also pressed at the same time. But if the robot is stationary, the top thread should kick in when we press 4th touch sensor, shouldn't it?
Answers.UserDisplayName: Konstantin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-03T02:36:13.267Z
Answers.Text: No, the switch blocks just check the touch sensor state and continue with one branch or the other depending on the current state. You would have to add a wait block to only "activate" the middle thread when a touch sensor is pressed.
Answers.UserDisplayName: David Lechner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-02T18:07:19.117Z
Answers.LastActivityDate: 2015-12-02T18:07:19.117Z
Answers.UserDisplayName: David Lechner
Body: <p>We are extending famous Dave Parker's nxtprograms.com <a href="http://nxtprograms.com/programs2/2TouchRemote.rbt" rel="noreferrer">2 Touch Remote</a>
  I have added 2 extra "threads" - one to control 3rd motor (which is a frontal "claw") and another one to use 4th touch sensor to reverse the robot. Please see screenshot enclosed. The issue we are experiencing is that the robot does not reverse when we press 4th touch sensor, although it does make sound. I am wondering if there's some kind of limitation - eg. you can't control same motors from different threads?<a href="https://i.sstatic.net/WLCAy.png" rel="noreferrer"><img src="https://i.sstatic.net/WLCAy.png" alt="Please see program screenshot"></a></p>
  
Tags: <motor><nxt-g>
Title: NXT2 motors limitation?
UserDisplayName: Konstantin
ThreadText: # NXT2 motors limitation?
  
  (Asked by: username_0 on 2015-12-02)
  
  We are extending famous Dave Parker's nxtprograms.com [2 Touch Remote](http://nxtprograms.com/programs2/2TouchRemote.rbt)
  I have added 2 extra "threads" - one to control 3rd motor (which is a frontal "claw") and another one to use 4th touch sensor to reverse the robot. Please see screenshot enclosed. The issue we are experiencing is that the robot does not reverse when we press 4th touch sensor, although it does make sound. I am wondering if there's some kind of limitation - eg. you can't control same motors from different threads?[![Please see program screenshot](https://i.sstatic.net/WLCAy.png)](https://i.sstatic.net/WLCAy.png)
  
  **Tags:** motor, nxt-g
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-12-02. Score: 1
  
  In the middle "thead" all of your motor blocks are "unlimited" or "stop". These blocks change the motor state and immediately continue to the next block. These are inside a loop that loops forever, so these blocks are running continuously in the loop. The motor blocks in the top thread may have an effect for a split second until the middle thread loops again and changes what the motor is doing.
  
  I suggest writing to a variable in the top thread instead of using motor blocks. Then read from that variable in the middle thread. For example, you could use a numeric variable and give it a value of '1' for forwards and `-1` for reverse. Then in the middle thread, use a multiply math block to multiply the desired motor speed by the variable to change the direction.
  
  Or, for that matter, you could read the 4th touch sensor value in the middle thread and remove the top thread.
  
  > **Comments:**
  > **username_0**: Thank you, will try the suggested approach and post update here.  
  > **username_0**: wouldn't the motor blocks in the middle thread only "activate" when 1st touch sensor is pressed? Eg. middle thread kicks in when 1st button is pressed, and then checks if 2nd button is also pressed at the same time. But if the robot is stationary, the top thread should kick in when we press 4th touch sensor, shouldn't it?  
  > **username_1**: No, the switch blocks just check the touch sensor state and continue with one branch or the other depending on the current state. You would have to add a wait block to only "activate" the middle thread when a touch sensor is pressed.  
  
  ---
  
  