To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 21939
21938  |  21940
Subject: 
Re: nop in NQC?
Newsgroups: 
lugnet.robotics
Date: 
Tue, 6 Jan 2004 00:56:06 GMT
Viewed: 
873 times
  
In article <Hr150r.vu2@lugnet.com>, "Brian Davis" <brdavis@iusb.edu>
wrote:

   Is there a NQC command that will translate to a simple nop bytecode? I'm
looking for a way to do fine-precision timing, and frankly checking a timer
takes too long. For very fine motor control, I'm trying to use sequences
like:

On(OUT_A+OUT_C);
Off(OUT_A+OUT_C);

I'm trying to run the motors at an effective slow speed, while still at a
reasonable power level. This works, but I'm wondering if I can goose the
speed
up slightly with an effective nop or other single-bytecode command inbetween
the
On & Off commands.

I think all of the single bytecode commands have side effects, which may
or may not matter to you.  You might want to use UnmuteSound().

Another option would be to create a command that does nothing.  For
example, a jump to the following command:

__nolist void NOP() { asm { 0x27, 1 }; }


Or assigning var 0 its own value:

__nolist void NOP2() { asm { 0x14, 0, 0, 0, 0 }; }


For both of these cases you need to create the asm functions defined
above and not use higher level syntax since NQC will usually optimize
out statements like x=x;

Dave

p.s.  I haven't tested either of the above functions on an RCX - I'm
going from memory here.  Use at your own risk.



Message is in Reply To:
  nop in NQC?
 
Is there a NQC command that will translate to a simple nop bytecode? I'm looking for a way to do fine-precision timing, and frankly checking a timer takes too long. For very fine motor control, I'm trying to use sequences like: On(OUT_A+OUT_C); (...) (21 years ago, 5-Jan-04, to lugnet.robotics)

8 Messages in This Thread:






Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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