Thread: Look Up Tables
View Single Post
  #6   Spotlight this post!  
Unread 01-03-2005, 12:02
Squirrelrock's Avatar
Squirrelrock Squirrelrock is offline
I may be teh programmer?
AKA: Keegan
FRC #0414
Team Role: Programmer
 
Join Date: Nov 2004
Rookie Year: 2003
Location: Richmond VA
Posts: 333
Squirrelrock will become famous soon enoughSquirrelrock will become famous soon enough
Send a message via AIM to Squirrelrock
Re: Look Up Tables

Quote:
Originally Posted by amateurrobotguy
First, I would like to say thanks to all the people that give support to me and others on these forumns.

Next, since I can't use math functions, it has been suggested that a look-up table be used. I can make the tables, but how to I read data from them? Like on table 1 find this number. Then from that number, goto table 2 with the same row and find that number.

const int table_length = 18;
rom const int x[]= {0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 210, 225, 240, 255};
rom const int y[]= {0, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 210, 225, 240, 255};

Basically I want something like:
Search x(135)
a=x postition
goto y(a)
If you're trying to have a table for autonomous points to drive to or some such nonsense, make a separate program to handle the tables on another computer that then inputs those cooridinates to the OI to send to the RC to drive to. (Contact Scitobor 617 for details on this program he's writing.)

If you're using these tables for speed control, then use % of the distance traveled (use an encoder) to determine speed.

If it's neither, I have no clue.

Squirrel
__________________
Look what I did to Dave:
Aaacckkk! Guurrkkk! Sssnorrrrkkkkk! Brain ... explode ... will. AAAArrrrggghhh!! Must ... not ... think ... about ... 2007 ... yet. Uuurrgghh!!! Still ... have .... to ... resolve ... how ... to ... pack ... parachutes ... for ... 2006 ... Ooorrrkkggnn!!
Sweet!

The scientists of today think deeply instead of clearly. One must be sane to think clearly, but one can think deeply and be quite insane.
- Nikola Tesla

Genius might be described as a supreme capacity for getting its possessors into trouble of all kinds.
- Samuel Butler