Go to Post For me Gracious Professionalism is about helping other teams make their ideas work. We do everything we can to help other teams program, or lend them parts from our pit. On the field we play to win. - Alpha Beta [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 10-02-2006, 09:49
scottmso scottmso is offline
Registered User
FRC #1561 (RoboDucks)
Team Role: Programmer
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Oklahoma City, OK
Posts: 26
scottmso is an unknown quantity at this point
Send a message via AIM to scottmso
Math functionality in EasyC?

I'm trying to see if I can design a function to help calculate a trajectory for our robot. Does EasyC have the math libraries that I would need to do this such as sin, cos, and tan? The other programmers didn't want to learn C this year (even though they had the opportunity) and seem to want to use EasyC but I would personally rather program it in regular C (MPLAB) especially if I will need to use it for what I want to do. Thanks
  #2   Spotlight this post!  
Unread 11-02-2006, 08:16
BradAMiller BradAMiller is online now
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Math functionality in EasyC?

Quote:
Originally Posted by scottmso
I'm trying to see if I can design a function to help calculate a trajectory for our robot. Does EasyC have the math libraries that I would need to do this such as sin, cos, and tan? The other programmers didn't want to learn C this year (even though they had the opportunity) and seem to want to use EasyC but I would personally rather program it in regular C (MPLAB) especially if I will need to use it for what I want to do. Thanks
You can get all the standard math libraries which are described in the Microchip C18 Users Guide. To do this and not get compiler errors you must include <math.h> which can be done from the "File inclusion" dialog on the Options menu. Make sure to include the <> as part of the file name.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #3   Spotlight this post!  
Unread 14-02-2006, 17:29
JJMax7 JJMax7 is offline
Registered User
None #0918 (Circuit Chargers)
Team Role: Driver
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Oklahoma
Posts: 22
JJMax7 is an unknown quantity at this point
Send a message via AIM to JJMax7
Re: Math functionality in EasyC?

Where should we place the math.h file?
  #4   Spotlight this post!  
Unread 14-02-2006, 17:36
Tobaby817's Avatar
Tobaby817 Tobaby817 is offline
RoboCoach/Designer Extraordinare
AKA: Toby
FRC #1396 (Pyrobots)
Team Role: Coach
 
Join Date: Apr 2004
Rookie Year: 2004
Location: Staten Island, NY
Posts: 7
Tobaby817 is an unknown quantity at this point
Send a message via AIM to Tobaby817
Re: Math functionality in EasyC?

in the file where you use the mathematical functions. #includes are only useful for the file you put them in
__________________
"If at FIRST you don't succeed, you're probably on Team 1396"



--Washers are for women--
  #5   Spotlight this post!  
Unread 14-02-2006, 21:11
intelitek_Chris intelitek_Chris is offline
Registered User
no team
 
Join Date: Dec 2005
Location: Manchester
Posts: 19
intelitek_Chris will become famous soon enoughintelitek_Chris will become famous soon enough
Re: Math functionality in EasyC?

The math header file is already included in the compiler. All you need to do is go to the File Inclusion Window in the options menu, and type in:
'
<math.h>
'
Then you will have access to the functions provided by that header file, such as sin, cos, tan, etc.
  #6   Spotlight this post!  
Unread 16-02-2006, 09:59
TEAM1949 TEAM1949 is offline
Registered User
FRC #1949
 
Join Date: Jan 2006
Location: IsRaEl
Posts: 24
TEAM1949 is an unknown quantity at this point
Re: Math functionality in EasyC?

after I include the file I wiil be able to see it like that : #include <sdsdsd>
????

Or it will automaticlly put it in the main.h ?
  #7   Spotlight this post!  
Unread 16-02-2006, 11:19
gabrielse's Avatar
gabrielse gabrielse is offline
Registered User
FRC #1748 (Lab Rats)
Team Role: Teacher
 
Join Date: Jun 2005
Rookie Year: 2004
Location: Baltimore
Posts: 55
gabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to behold
Re: Math functionality in EasyC?

Quote:
Originally Posted by TEAM1949
after I include the file I wiil be able to see it like that : #include <sdsdsd>
????

Or it will automaticlly put it in the main.h ?
Give it a try, just don't forget that math.h uses radians to measure angles.
  #8   Spotlight this post!  
Unread 16-02-2006, 14:52
BradAMiller BradAMiller is online now
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Math functionality in EasyC?

Quote:
Originally Posted by TEAM1949
after I include the file I wiil be able to see it like that : #include <sdsdsd>
????

Or it will automaticlly put it in the main.h ?
The actual include declaration gets inserted into the Main.h file as you said and the Main.h file is included in all the other files you create.

The only way to see it is to look at the "Project" tab on the left hand window. Then you can select Main.h and see the includes.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
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
Math in careers EricH Career 40 24-06-2008 21:45
EasyC Wish List dcbrown Programming 32 14-08-2006 09:24
EasyC v2.0 is mandatory for FVC! skimoose FIRST Tech Challenge 7 14-01-2006 18:37
Kickoff easyC workshop integrated into EasyC help file Dan Larochelle Programming 0 11-01-2006 06:12


All times are GMT -5. The time now is 07:21.

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