![]() |
Re: New C18 3.0+ Compatible FRC Code
Julan,
Did you define the number of channels in the adc.h file? Kevin, The code runs fine if called ifi_frc.hex.....if I change the project in the same subdirectory with all the same files, I get a stuck programming mode light. So I won't every change the name, but I'd still like to know why this hapens!! Jon |
Re: New C18 3.0+ Compatible FRC Code
Yes I Did
|
Variables Change randomly
PLEASE I CANNOT TAKE THIS ANYMORE
Any functions I create return seemingly random numbers for example I put the function unsigned int Motor_Limit (int motor) { static unsigned int lmnewmotor; if(motor >= 254) { lmnewmotor = 254; } if(motor <= 0) { lmnewmotor = 0; } } In ifi_code.c and a prototype in ifi_code.h. I call it with motor1 = Motor_Limit((int) motor1); where motor1 is a pwm value that may be invalid. IT ALWAYS RETURNS 1919!!!! WHYYYYYYYYYY Is this a bug, I have the sensors version and kevin's site said that it was relatively bug free. We have a demo tomorrow and whenever I try to run my code the robot goes int a spasm. |
Re: Variables Change randomly
Quote:
But upon further inspection, the problem with your code is rather obvious to someone who hasn't been staring at it for hours. You merely forgot to return the newly computed value. :P |
Re: New C18 3.0+ Compatible FRC Code
I cannot adequately express my frustration with myself and the people here who I asked to check this for error. Thank you for pointing out that I DIDNT HAVE IT RETURN ANYTHING AAAAAAAAAAAAA:ahh: :ahh:
|
Re: New C18 3.0+ Compatible FRC Code
I looked at the link that was provided for a version of C18 other than 3.15 but couldn't find it. Can someone point to me where it is? >.< Any help appreciated.
-- Hank |
Re: New C18 3.0+ Compatible FRC Code
Quote:
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
Okay, so yesterday I modified the code to gain more headroom (ADXRS150 w/ default settings rolls over in just over five revolutions) and implemented a scheme where complete revolutions are detected, counted, and then subtracted from the total angle. In this way the number of revolutions is accounted for separately from the angle. The downside is that the code is somewhat bloated and convoluted. I guess I'd like to keep the status quo with additonal headroom and dump the loop counting code, but I'd like to get some feedback on what teams want. -Kevin |
Re: New C18 3.0+ Compatible FRC Code
Quote:
As for feedback; Honestly, currently we don't have a need to keep track of heading for up to five revolutions. In fact, this year we will really only be expecting the code to track up to one and a half revolutions. So, as it is now, it will work just fine. On another note, I am curious as to the outcome of the question/observation PhilBot had when he posted this" Quote:
|
Re: New C18 3.0+ Compatible FRC Code
Quote:
return((int)(((((long)gyro_rate * GYRO_SENSITIVITY * 5L) / ADC_RANGE)) * GYRO_CAL_FACTOR)); -Kevin |
Re: New C18 3.0+ Compatible FRC Code
Quote:
Thanks again Kevin. Your work is appreciated more than I can express. |
Re: New C18 3.0+ Compatible FRC Code
And here is some code to remap gyro values to the standard format
rev = temp_gyro_angle/3600; if (temp_gyro_angle < 0) { gyro = temp_gyro_angle - (3600*(rev)); if (gyro < 1800) { gyro+= 3600; } } if (temp_gyro_angle > 0) { gyro = temp_gyro_angle - (3600*(rev)); if (gyro > 1800) { gyro-= 3600; } } if (gyro > 1800) { gyro -= 3600; } |
Re: New C18 3.0+ Compatible FRC Code
We are trying to compile and down load the base 3.0 code using MPLab IDE 7.62 and the Upgrade version of C18 compiler to 3.10. We tried downloading to the 2006 and 2007 controllers (8722). However, we are getting a code error and the program light is flashing rapidly.
My question is a) can the 3.0 code work in the 2006/2007 controllers? If so, then what other situation may cause the program error to light and program light to blink rapidly? Edited: Found the problem. I had forgotten to uncomment the defines in ifi_frc.h; but I had uncommented everything else in the rest of the code. No error messages during the build, but immediately after the the download the controller was crashing. Also, Kevin, thanks for the great work on the code this year. D. Sean Kelly Toltechs #499 MPLab IDE 7.62 C18-Compiler 3.10 |
Re: New C18 3.0+ Compatible FRC Code
Quote:
I'd like to add my thanks for the great work on the new framework. We use the 8520 for small groups prototyping code. I know you are working on a set of code that will work for all controllers, but I was wondering if the message you have in adc.c: * This version will only work with PIC18F8722 based robot * controllers. You should use version 0.3 of this software * with a PIC18F8520 based robot controller. is still valid. And if so, how would I go about getting version 0.3 of the adc.[ch]? Thanks! |
| All times are GMT -5. The time now is 14:27. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi