![]() |
MPLAB and 62 char filename limit
Hey. I just did a rewrite of the code for the 2005-2008 robots we have lying around, since we were either missing it or it was partially broken... Anyway after fixing the multitude of syntax errors and linker errors (:P) I got a very interesting linker error. It said something along the lines of "file C:\Users\Team1546\Desktop\Robotics Code\Current\Pre-09 Code Base\v1.3\autonomous.o violates 62 character filename limit". I solved this by simply moving the project directory (v1.3) to the C drive root and it built just fine. I'm wondering if there's any solution for this rather annoying filename limitation or if I just have to live with it. I'm running Vista, if that matters.
|
Re: MPLAB and 62 char filename limit
That can be solved by a button click too if you don't want to bother moving your files (I'm kind of lazy).
Project -> Build Options... -> Project Go to the "MPLINK Linker" tab Click on "Suppress COD-file generation" Creating that file is when you get the 62 character limit message, and it isn't used by us for anything so it's unnecessary anyway. P.S. Your version of MPLAB is different than mine, so you may have to search around a little to find it. |
Re: MPLAB and 62 char filename limit
Hey Lord jeremy I an using the old robots for demos at my school,
would you be willing to share some of your code, partcularly any autononmous code? thanks John |
Writing an Autonomous
Quote:
First of all, I based my code on Kevin Watson's FRC code, available at http://kevin.org/frc/. Specifically, I'm pretty sure I started with the ifi_frc_sensor.zip code. Looking at the page again, I see that he has ifi_clock.zip, which probably would help with an autonomous routine. I did without the clock and instead wrote my own code to keep track of time for the purpose of autonomous timing. The first step to writing autonomous is looking at how it can interface with your robot control routines. For instance, all my drive code is contained within a function called TankDrive, which takes parameters of two joysticks and two output PWM pointers. To facilitate autonomous control of drive, I chose to write a separate function in a separate C file called AutoTankDrive, which just took the parameters of two output PWM pointers. That way, I could call AutoTankDrive in the Autonomous function of Kevin's autonomous.c with two PWM values - the values of the motors. Inside the AutoTankDrive function, I would just have calls to TankDrive, but instead of passing joystick values as parameters I would pass defined integers. To see what I mean, check out the following simplified version of my code: Code:
void AutoTankDrive( unsigned char *pOutput1 , unsigned char *pOutput2 )Now onto the next part of autonomous, selecting a mode. I wrote four functions for selecting the mode, SelectAutonomous1Input through SelectAutonomous4Input. Each takes either 1, 2, 3, or 4 inputs from digital ins - the switches on the robot. I wrote four of them so that it's very easy to increase or decrease the number of switches being used. They all modify the same variable, cCurrentAutonomousRoutine. All I did was bitshift the inputs and bitwise OR them. What that means is that say input 1 is 1, input 2 is 0 and input 3 is 1. Input 3 * 100 + Input 2 * 10 + Input 1 * 1 = 101, which in binary is routine number 5. This is what it looks like: Code:
void SelectAutonomous4Input( char cInput1 , char cInput2 , char cInput3 , char cInput4 )Code:
T0CONbits.T0PS0 = 1;Code:
void AutonomousTick( unsigned int iPeriod )Anyway, I think that's about it. Post back or PM me if you need any additional help. Sorry, but I'm loathe to post the codebase I've put together because I did a lot of weird stuff so that we could use the same code for four different robots. It's very confusing to look at >.> |
| All times are GMT -5. The time now is 01:11. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi