Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Problem with Kevin's 2008 code (http://www.chiefdelphi.com/forums/showthread.php?t=63415)

jc4p 06-02-2008 17:27

Problem with Kevin's 2008 code
 
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

Re: Problem with Kevin's 2008 code
 
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
Code:

pwmXX = pX_y;

Kevin Watson 06-02-2008 17:38

Re: Problem with Kevin's 2008 code
 
Quote:

Originally Posted by jc4p (Post 693401)
...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

Re: Problem with Kevin's 2008 code
 
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

Re: Problem with Kevin's 2008 code
 
Quote:

Originally Posted by jc4p (Post 693410)
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


All times are GMT -5. The time now is 23:53.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi