To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 123
122  |  124
Subject: 
Re: NQC 2 Request
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Wed, 15 Sep 1999 23:38:35 GMT
Viewed: 
3451 times
  
In article <37DE2468.66B220C4@sundayta.co.uk>, David Warnock
<david@sundayta.co.uk> wrote:

I just wondered whether it might be handy to add OnFwdFor(motors) and
OnRevFor(motors).


If anyone wants to add these functions into their own code...

void OnFwdFor(const int m, const int &t) { Fwd(m); OnFor(m, t); }
void OnRevFor(const int m, const int &t) { Rev(m); OnFor(m, t); }

These should be efficient - everything will be inlined and no temporaries
will be created - unless a temporary is needed during the computation of
t...

int x, y;
OnFwdFor(x); // ok, no temporary
OnFwdFor(x+y);  // need temp to compute x+y

Dave

--
reply to: dbaum at enteract dot com



Message has 1 Reply:
  Re: NQC 2 Request
 
Dave, Thanks for all the comments in the thread. As I have not looked at the API supplied by the firmware I did not realise that the NQC api was such a close match. Adding the functions as you have suggested is a very neat solution. It is nice to (...) (25 years ago, 16-Sep-99, to lugnet.robotics.rcx.nqc)

Message is in Reply To:
  NQC 2 Request
 
Hi, I just wondered whether it might be handy to add OnFwdFor(motors) and OnRevFor(motors). Regards Dave (25 years ago, 14-Sep-99, to lugnet.robotics.rcx.nqc)

8 Messages in This Thread:



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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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