Go to Post "Recycle Rush? What's that, some sort of charity marathon?" - Chak [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-02-2006, 21:15
revolution1737 revolution1737 is offline
Robot Overlord
FRC #1691 (Revolution1737)
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Sidney
Posts: 9
revolution1737 will become famous soon enough
Look up table

I am programming an omnidrive system and I decided to make look up tables instead of sin and square root functions. Can somebody point me in the right direction as I have never done something like this?
  #2   Spotlight this post!  
Unread 08-02-2006, 21:25
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Look up table

Quote:
Originally Posted by revolution1737
I am programming an omnidrive system and I decided to make look up tables instead of sin and square root functions. Can somebody point me in the right direction as I have never done something like this?
Hi, well, basically, you would have something like:

Code:
rom const float sin[]={(here, list values of sin, from 1-90, with values separated by commas)};
and then, you would get the sin of the angle, lets say theta==20, by calling:

Code:
sin[20];
Hope this helps,
__________________
  #3   Spotlight this post!  
Unread 09-02-2006, 00:46
revolution1737 revolution1737 is offline
Robot Overlord
FRC #1691 (Revolution1737)
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Sidney
Posts: 9
revolution1737 will become famous soon enough
Re: Look up table

Thanks, thats exactly what I wanted. I only have one question. I read in a post by kevin that you could post this table in the eeprom. I was wondering if I should try to put it there or where I call my function.
  #4   Spotlight this post!  
Unread 09-02-2006, 00:50
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Look up table

Quote:
Originally Posted by revolution1737
I am programming an omnidrive system and I decided to make look up tables instead of sin and square root functions. Can somebody point me in the right direction as I have never done something like this?
I have some code that I started last Fall that might be of some use. One application, trig_table.c/.h, is only run once to create a semi-permanent table in EEPROM. The second application, trig.c/.h, demonstrates how to lookup a value within the table. The code is designed to work with the EEPROM code on my website: http://kevin.org/frc. I haven't written the documentation yet and don't know when I'll have the time, so if you have questions, feel free to ask 'em here. You can find the code here: http://kevin.org/frc/frc_trig.zip.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #5   Spotlight this post!  
Unread 09-02-2006, 01:11
revolution1737 revolution1737 is offline
Robot Overlord
FRC #1691 (Revolution1737)
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Sidney
Posts: 9
revolution1737 will become famous soon enough
Re: Look up table

Speak of the devil -- LOL

Thanks, you just saved me a day of programming. If it's all right I may PM you tomorrow if I come across any glitches.

Thanks

ps I was looking through the code in notepad and I see that there are 8 and 16 bit functions of sin. Are these what I call and if so do I need to call them both?

Last edited by revolution1737 : 09-02-2006 at 01:16.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[RCU]: Kettering Kickoff table Lisa Perez General Forum 0 29-08-2005 12:33
Sortable table for use on webpages Elgin Clock Website Design/Showcase 2 22-05-2005 17:09
full table? Shlomi32 General Forum 2 27-04-2005 10:03
Lookup table generation tool WillyC Programming 12 15-02-2004 21:01
table corruption... round 2 Brandon Martus Announcements 0 18-12-2001 23:57


All times are GMT -5. The time now is 01:36.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi