Log in

View Full Version : Problem with Kevin's 2008 code


jc4p
06-02-2008, 17:27
Hello,
We used to have the 2007 code from IFI's site in our controller, and it worked fine. Now, I have upgraded to Kevin's 2008 code, along with upgrading our MPLAB (7.21), and MCC (3.1). When we put the compiled version of the 2008 code in the controller, all the code we have works except the controller code.
Meaning when we make code in our autonomous.c be "pwmwhatever = 255", it works, but the p1_y = pwmwhatever code does not.
The controller code works if we use the old compiled hex of the 2007 code, so it can't really be a hardware problem.

Has anyone encountered this before, or does anyone have any suggestions?

DanDon
06-02-2008, 17:31
Assignments in C work from right to left (i.e. take the value on the right side of the '=' and store it into the variable on the left of the '=').

In which case your code should look like

pwmXX = pX_y;

Kevin Watson
06-02-2008, 17:38
...but the p1_y = pwmwhatever code does not. ...anyone have any suggestions?Yes, it should be "pwmwhatever = p1_y". I maybe wrong, but I don't think this has anything to do with my code :rolleyes:.

-Kevin

jc4p
06-02-2008, 17:40
edit:
Turned out I had something commented out in the teleop.c and now that I uncommented it works perfectly.

Thanks Kevin, you're magic :)

Kevin Watson
06-02-2008, 17:48
I was reading the giant thread and realized I need to enable one of the encoders, now that I have enabled channel 4 in ifi_frc.h and enabled the Initalization in teleop.c...You forgot to read the readme.txt file, which tells you to also enable the call to the ISR in ifi_frc.h :D.

-Kevin