Go to Post Cameras, colors, and tetras, oh my! - galewind [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 25-01-2005, 20:31
farmer farmer is offline
Tired Mentor
AKA: Matt
#1108 (Panther Robotics)
Team Role: Engineer
 
Join Date: Jan 2005
Location: Kansas
Posts: 8
farmer is an unknown quantity at this point
Where to insert code?

Ok new FIRST programmer here.....where are we allowed to insert code. For example, we want to change the sensitivity of our joy stick drive by using an array (we think). Does this go in user_routines.c ? and if so, does it matter where?
  #2   Spotlight this post!  
Unread 25-01-2005, 22:01
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Where to insert code?

Quote:
Originally Posted by farmer
Ok new FIRST programmer here.....where are we allowed to insert code. For example, we want to change the sensitivity of our joy stick drive by using an array (we think). Does this go in user_routines.c ? and if so, does it matter where?
You put your actual code to drive the robot in user_routines.c, in the Default_Routine function. Using some math functions you should be able to change the sensitivity of the joystick.
__________________
http://www.mikesorrenti.com/
  #3   Spotlight this post!  
Unread 25-01-2005, 22:50
russell's Avatar
russell russell is offline
Registered User
#1430 (WRONG)
Team Role: Electrical
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Anchorage AK
Posts: 402
russell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to allrussell is a name known to all
Re: Where to insert code?

Yeah, what he said. You are going to want to study it some because the default code uses somthing called limit mix at least for the one joystick drive. I forget what it does but I think it had something to do with making sure that your pwm values did not exceed 255 or go below 0. Or something.
  #4   Spotlight this post!  
Unread 26-01-2005, 00:21
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Where to insert code?

Quote:
Originally Posted by farmer
Ok new FIRST programmer here.....where are we allowed to insert code. For example, we want to change the sensitivity of our joy stick drive by using an array (we think). Does this go in user_routines.c ? and if so, does it matter where?
Files that you aren't supposed to modify are clearly labeled in the comments at the top of said files. The most common places of adding code are in user_routines.c (usually for driver code), and user_routines_fast.c (for autonomous, and processing interrupts and the like). In these files, you will find a comment to the effect of:
Code:
/*Add your code here.*/
If you put your code there, you are much more likely to get the results you expect.
Quote:
Originally Posted by russell
Yeah, what he said. You are going to want to study it some because the default code uses somthing called limit mix at least for the one joystick drive. I forget what it does but I think it had something to do with making sure that your pwm values did not exceed 255 or go below 0. Or something.
What the limit mix functions do is take the values of the x and y axis of the joystick, and convert them to the numbers that you would want the motors to do. It's just a little bit of math.
Quote:
Originally Posted by MikeWasHere05
Using some math functions you should be able to change the sensitivity of the joystick.
Yep... using a math formula is a much better idea than using a lookup table, which would be horribly inefficient with the limited resources we have. See this post for one example.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #5   Spotlight this post!  
Unread 26-01-2005, 23:43
farmer farmer is offline
Tired Mentor
AKA: Matt
#1108 (Panther Robotics)
Team Role: Engineer
 
Join Date: Jan 2005
Location: Kansas
Posts: 8
farmer is an unknown quantity at this point
Re: Where to insert code?

Thanks everyone! Yeah I put in an array table but thinking about using a log formula instead. I keep getting an error when building -

MPLINK 3.90 Linker
Error - section ' .idata_user_routines.o' can not fit the section. Section ' .idata_user_routines.o' length=0x0000020c
Errors :1
  #6   Spotlight this post!  
Unread 27-01-2005, 00:10
Fat Alex's Avatar
Fat Alex Fat Alex is offline
Mr. super uber ultra Alex
AKA: Alex
#0060 (Bionic Bulldogs)
 
Join Date: Dec 2002
Rookie Year: 2002
Location: kingman
Posts: 29
Fat Alex is on a distinguished road
Send a message via MSN to Fat Alex
Re: Where to insert code?

Quote:
Originally Posted by farmer
Thanks everyone! Yeah I put in an array table but thinking about using a log formula instead. I keep getting an error when building -

MPLINK 3.90 Linker
Error - section ' .idata_user_routines.o' can not fit the section. Section ' .idata_user_routines.o' length=0x0000020c
Errors :1
if your array table does not change you could dosomething like:

rom const char myArray[2] = {1, 2};

the problem is you don't have enough memory in RAM for whatever array you have.

note: ya can't change it if its rom
and another: go to http://www.chiefdelphi.com/forums/sh...ad.php?t=33359 for more info
__________________
Shake the hand that shook the world
  #7   Spotlight this post!  
Unread 27-01-2005, 23:51
probizzle's Avatar
probizzle probizzle is offline
Registered User
AKA: Prabhas Pokharel
#0639 (Code Red)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2003
Location: Ithaca
Posts: 78
probizzle will become famous soon enoughprobizzle will become famous soon enough
Send a message via AIM to probizzle
Re: Where to insert code?

Quote:
Originally Posted by jgannon
Yep... using a math formula is a much better idea than using a lookup table, which would be horribly inefficient with the limited resources we have. See this post for one example.
I disagree.
Depends on how complex the math is I guess, but using ROM to store your loo up table yields pretty fast results.
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
Example gyro code released. Kevin Watson Programming 60 17-03-2005 18:32
Kevin Watson's Kick-off Demo Code! Mr. Lim Programming 27 22-01-2005 03:38
Sourceforge for Code Repository and other stuff SilverStar Programming 9 15-01-2005 21:16
A Centralized Code Dump? colt527 Programming 29 01-01-2005 16:07
heres the code. y this not working omega Programming 16 31-03-2004 15:18


All times are GMT -5. The time now is 03:06.

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