View Single Post
  #11   Spotlight this post!  
Unread 04-03-2008, 22:28
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: Last Minute Programmer - Need Help!

if pwms 4 and 5 are your left drive motors, and 6 and 7 are your right drive motors, you can do this for a single joystick drive (assuming you use IFI's code):

pwm04 = pwm05 = Limit_Mix(2000 + p1_y - p1_x + 127);
pwm06 = pwm07 = Limit_Mix(2000 + p1_y + p1_x - 127);

That will get you some basic drive capabilities with the port1 joystick. Keep in mind, if you use IFI's default code, that all the variables to control the robot that you would ever need are in "ifi_aliases.h".

interrupts are like tiny peices of code that will execute in response to something. With an interrupt, though, the code that is currently running is 'interrupted', and the processor will jump to another part of the code, do what it needs to, and jump back. That 'another part of the code' is the "interrupt_handler_low()" routine in user_routines_fast.c. Configurating an interrupt to work in the first place is half the battle... i would suggest taking a look at kevin watson's encoder code to get an idea how to set one up.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY

Last edited by Uberbots : 04-03-2008 at 22:32.