View Single Post
  #5   Spotlight this post!  
Unread 30-01-2005, 18:49
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,276
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Strange Auto Problem

Ok try this plug the motors into pwms 1 and 2 left into 1 and right into 2.
Add this to define t

static unsigned int t;
then paste this into user routines fast where is says add your autonomous code here,
t++;

if (t < 5)
{
pwm01 = 127;
pwm02 = 127;
pwm03 = 127;
pwm04 = 127;
}

else if (t < 179)
{
pwm01 = 254;
pwm02 = 0;
pwm03 = 254;
pwm04 = 0;
}
else if (t < 353)
{
pwm01 = 0;
pwm02 = 254;
pwm03 = 0;
pwm04 = 254;
}
else
{
pwm01 = 127;
pwm02 = 127;
pwm03 = 127;
pwm04 = 127;
}

then run the bot in autonomous. It should move forward and then backwards, If this works than try using joysticks in ports 1 and 2 to control the two sides of the drive, assign them to PWMs like this,

pwm01 = (p1_y/2)+64;
pwm02 = ((254-p2_y)/2)+64;

port 1 should drive left side and port two should drive the right.

If this all works then there shouldnt be a problem if it doesnt you have a few choices, first choice redownload the default code version 2.4 and try again, Upload your code for some one on here to look at, Your problem could be a misplaced / of a missing value. Or your thid choice double check your wiring and make sure your victors are set up properly.

James