To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.nxtOpen lugnet.robotics.nxt in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / NXT / 502
501  |  503
Subject: 
Re: Two motors at the same time... It is possible?
Newsgroups: 
lugnet.robotics.nxt
Date: 
Mon, 19 Feb 2007 14:47:08 GMT
Viewed: 
14600 times
  
The code is working right well!

But i think the stall control at the end o each task has no meaning there,
since the until loop does not let the script reach it if the motor become
staled.

// Verifies that motor doesn't rotate for 50ms, else loops
int rotCount = MotorRotationCount(OUT_A);
int oldRotCount = rotCount - 1;
while (oldRotCount != rotCount) {
   oldRotCount = rotCount;
   Wait(50);
   rotCount = MotorRotationCount(OUT_A);
}

SetOutput(OUT_A,
           OutputMode, OUT_MODE_COAST,
           RunState, OUT_RUNSTATE_IDLE,
           UpdateFlags, UF_UPDATE_MODE);
}



Patrick



Message is in Reply To:
  Re: Two motors at the same time... It is possible?
 
(...) It is possible. The NXC API doesn't currently wrap this capability in a really simple function. (...) The RotateMotor API function calls a subroutine written in NBC that does not return until the tachometer limit target has been reached. (...) (18 years ago, 19-Feb-07, to lugnet.robotics.nxt)

6 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in NXT programmable brick

 
Verified and Trusted Team of Hackers
15 hours ago
Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR