![]() |
Program doesn't effect robot
Ok, now my computer loads programs. The default loads, but only makes one wheel and our gatherer work. When I try to load my program, however, The robot is completely unresponsive of the joysticks.
This is my code from user_routines : void Default_Routine(void) { /*---------- Analog Inputs (Joysticks) to PWM Outputs----------------------- *-------------------------------------------------------------------------- * This maps the joystick axes to specific PWM outputs. */ /* 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; */ /*---------- 1 Joystick Drive ---------------------------------------------- *-------------------------------------------------------------------------- * This code mixes the Y and X axis on Port 1 to allow one joystick drive. * Joystick forward = Robot forward * Joystick backward = Robot backward * Joystick right = Robot rotates right * Joystick left = Robot rotates left * Connect the right drive motors to PWM13 and/or PWM14 on the RC. * Connect the left drive motors to PWM15 and/or PWM16 on the RC. */ // pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127); // pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127); if (p1_sw_trig == 1) { pwm03 = 200; // turn on the shooters pwm04 = 200; if (p2_sw_top == 0) { relay1_fwd = 0; relay1_rev = 0; //no gather movement durring aiming pwm08 = 120; //closed if (p2_sw_trig == 1) { pwm06 = p2_x/4; //pan pwm07 = p2_y/4; //tilt } else { pwm06 = 127; pwm07 = 127; //NOTE NOTE! this is for the auto aim code } } else { pwm08 = 50; //open } if (p2_sw_top == 1) { relay1_fwd = 1; //with both tops down, activates gatherer relay1_rev = 0; } else { relay1_fwd = 0; relay1_rev = 0; } } else { pwm01 = p1_y; //again, make a #define, probably pwm_1 pwm02 = p2_y; //Also a #define, pwm_2, make sure p1 joystic is on right } if (p1_sw_top == 1 && p2_sw_top == 0) { relay1_fwd = 0; relay1_rev = 1; //rev gatherer } else if (p1_sw_top == 0 && p2_sw_top == 1) { relay1_fwd = 1; relay1_rev = 0; } else { relay1_fwd = 0; relay1_rev = 0; } Also, when the terminal window opens, it reads <IFI> and thats it. (Unless it's the default code, and then it only reads the information for the joystick in port one ANY HELP??? PLEASE??? |
Re: Program doesn't effect robot
Are you sure that all the PWM wires are connected properly in correspondence with the program(s)?
|
Re: Program doesn't effect robot
Did you try inserting printfs for the joystick values (including buttons), to make sure the robot is getting the joystick input?
printf("%d\t%d\t%d\t%d\n", p1_y, p2_y, p2_sw_trig, p2_sw_top); Is everything plugged in (the motors)? I'm not sure if it was a problem with copying, but there's no ending curly brace for Default_Routine. Oh, also, a few other things, that probably aren't causing your problem, but might cause other problems: (In the code, I changed all "x == 1" to just "x" and "x == 0" to just "!x". It's still exactly the same.) Code:
if (p2_sw_trig)Code:
if (!p2_sw_top) |
Re: Program doesn't effect robot
Make doubly sure the call to Default_Routine() is not commented out. (If you're starting with the 2006 code with camera support, it is unless you changed it.)
|
Re: Program doesn't effect robot
Quote:
|
Re: Program doesn't effect robot
How many Joistick can I use in the competition...
|
Re: Program doesn't effect robot
can anyone help explain rewriting the c programming were a rookie team struggling with it
|
Re: Program doesn't effect robot
Quote:
Steve |
Re: Program doesn't effect robot
how to wire the pressure switch right for our nuematics
|
| All times are GMT -5. The time now is 01:24. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi