We're moving to WPILib this year and are having a few issues getting our code working with the FRC controller. We tested it out quite a bit on the Vex robots last fall and it worked great, but we tried downloading to last year's FRC bot for the first time today and couldn't get it to work.
The code below compiles and downloads, but does nothing after that. We were trying to get basic drive working first with the Tank2 function (We have one CIM motor on each side, plugged into PWM ports 13 and 15). Then we commented out the Tank2 function to see if we could just get the motors to turn on at all with the SetPWM function, and that didn't work either. Any ideas what we're doing wrong?
We are using MPLab v8.00, the C18 Compiler v2.40, and IFILoader v1.10.
Code:
#include "BuiltIns.h"
void IO_Initialization(void) {
SetCompetitionMode(1);
}
void Initialize(void) {
DefineControllerIO(INPUT, INPUT, INPUT, INPUT, INPUT, INPUT, INPUT, INPUT, INPUT,
INPUT, INPUT, INPUT, INPUT, INPUT, INPUT, INPUT, INPUT, INPUT);
}
void Autonomous(void) {
printf("Autonomous\r");
while(1) {
printf("In Autonomous\r");
SetPWM(13, 50);
SetPWM(15, 50);
}
}
void OperatorControl(void) {
printf("OperatorControl\r");
while(1) {
printf("In OperatorControl\r");
SetPWM(13, 50);
SetPWM(15, 50);
//Tank2(1, Y_AXIS, 2, Y_AXIS, 13, 15, 0, 1);
}
}
void main(void){
}