NEED HELP WITH PROGRAMMING

HEY
WE ARE A ROOKIE TEAM AND WE HAVE NO IDEA WHAT TO DO AND WE WANT TO SEE A SAMPLE CODE IN TELEOPARATED MODE ANY HELP???

Maybe you shouldn’t yell and people would help.

But are you programming in EasyC or MPLAB?

MY BAD WASNT TRYING TO YELL
WELL WE ARE USING MPLAB

Go download the default code. Open up user_routines and read the comments. It should have enough code to get your robot driving as is.

In general when ‘speaking’ on the internet, using ALL CAPS is considered yelling. That’s what iwin2000 was probably getting at.

By the way, the default code can be found near the bottom of the this page. It’s labeled ‘2007 RC Code’. If I remember correctly, IFI hasn’t released any different code for the 2008 season. If I’m wrong, someone will almost definitely correct me :slight_smile:

We have gone through the default code, but we are missing what the code means. We have someone to help us with C programming, but how do we define things so that they match up with physical layout on the robot control. Is there some manual that helps explain some of this. For example:

pwm01 = p1_y;
pwm02 = p2_y;
pwm03 = p3_y;
pwm04 = p4_y;
pwm05 = p1_x;
pwm06 = p2_x;
pwm07 = p3_x;
pwm08 = p4_x;
pwm09 = p1_wheel;
pwm10 = p2_wheel;
pwm11 = p3_wheel;
pwm12 = p4_wheel;

The comments help in the program, but we need some more direction.

Take a look at the IFI user guide to the default code: http://www.ifirobotics.com/docs/legacy/frc-rc-default-software-ref-guide-2004-1-7.pdf

Also see http://www.ifirobotics.com/docs/legacy/2004-programming-reference-guide-12-apr-2004.pdf

Both are linked from the IFI webpage that CardcaptorRLH85 refered to.

Programming reference guide:

Default code reference guide:

Basically what’s going down below is that the pwm outputs on the robot controller are being mapped to the joystick inputs on the OI. So if you plug in a joystick to port 1 of the OI, and push it foward all the way, p1_y will be 255. This 255 on the Pwm01 will tell the speed controller to go +12V across the motor. Pulling it all the way back would give you a 0 on pwm01. This is a signal to go -12V for the speed controller(running a motor in reverse). When the joystick is at rest it is at a neutral value of 127.

So with what’s setup below if you plug in joysticks to the OI in ports 1 and 2. Then plug in your speed controllers for your drive into PWMs 1 and 2. Then you should be able to drive your robot with 2 joysticks.

pwm01 = p1_y; //Map the y axis of joystick 1 to pwm01
pwm02 = p2_y; //Map the y axis of joystick 1 to pwm02
pwm05 = p1_x; //Map the x axis of joystick 1 to pwm01
pwm06 = p2_x; //Map the x axis of joystick 1 to pwm02