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 / 15099
15098  |  15100
Subject: 
Re: Struggling with encoder wheel
Newsgroups: 
lugnet.robotics
Date: 
Thu, 12 Apr 2001 21:20:59 GMT
Viewed: 
963 times
  
In article <3AD53475.9F8ABD16@airmail.net>,
Steve Baker <sjbaker1@airmail.net> wrote:
If it's not faster (because of it doing 64 comparison/if's in the
worst case) then you can use a binary 'if/else' tree:

Hey, that was a great idea! I couldn't use ?/: to do it (NQC doesn't
know those operators), had to actually write out all the if/else, but
I actually just added it into my wheel generation program, so it
printed out the function for me and I cut&pasted. That's a *lot*
faster than looping through the array like I was doing before.

Now to figure out why it still isn't turning like I want it to. :-)

--
Chris Osborn                      Full System, Inc.
fozztexx@fullsystem.com           2160 Jefferson St., #240
http://www.fullsystem.com/        Napa, CA 94559
Webhosting that *works* - 99.99% uptime - First 3 months free



Message is in Reply To:
  Re: Struggling with encoder wheel
 
(...) Can't you just use a large switch() statement inside a function to simulate a 64 element array? If none of the values in the array ever change: int array ( int x ) { switch ( x ) { case 0 : return element_0 ; case 1 : return element_1 ; case 2 (...) (24 years ago, 12-Apr-01, to lugnet.robotics)

19 Messages in This Thread:






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

 
Contact Recovery Nerd for Speedy USDT / BTC Recovery
23 hours ago
Custom Search

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