View Single Post
  #3   Spotlight this post!  
Unread 08-02-2006, 18:57
Semicolon's Avatar
Semicolon Semicolon is offline
Registered User
#0399
 
Join Date: Feb 2005
Location: California
Posts: 21
Semicolon will become famous soon enough
Re: Another Loader Error

Quote:
Originally Posted by Tureyhall
it ALWAYS helps to see the code AND the errors/hex that came with the errors.
Here you go. Can't get errors right now, but could you tell me how to find out what they mean?

Quote:
/************************************************** *****************************
*
TITLE: 399Auto.c
*
* VERSION: 0.1 (Beta)
*
* DATE: 04-Oct-2005
*
* AUTHOR: Semicolon
*
* COMMENTS: Hello!
*
************************************************** ******************************
*
* CHANGE LOG:
*
* DATE REV DESCRIPTION
* ----------- --- ----------------------------------------------------------
* Nothing
*
************************************************** *****************************/
//--Header Files--\\
#include <stdio.h>
#include <math.h>

#include "ifi_aliases.h"
#include "ifi_default.h"
#include "ifi_utilities.h"
#include "user_routines.h"
//#include "user_Serialdrv.h"
#include "399code.h"
#include "399Auto.h"
#include "tracking.h"
#include "camera.h"

#define AUTOSPEED 50
#define AUTOFWD 127+AUTOSPEED
#define AUTOBK 127-AUTOSPEED
#define MOTORSTEP 1

extern int motor01accel;
extern int motor02accel;
extern int AutoState;
extern int Centering;
int RobotTime = 0;
extern int Alarm;
extern int cent;
extern int dista;
extern int motor03;
extern int motor04;
extern int motor01;
extern int motor02;



/************************************************** *****************************
* FUNCTION NAME: TimerUpdate
* PURPOSE: Updates the robot time
* CALLED FROM: Autonomous399()
* ARGUMENTS: void
* RETURNS: void
* NOTES: Robot Time is in miliseconds
************************************************** *****************************/
void TimerUpdate(void)
{
// RobotTime = RobotTime + 26;

// printf("RobotTime:%d\r\n",RobotTime);
}
/************************************************** *****************************
* FUNCTION NAME: SetAlarm
* PURPOSE: Sets an alarm that will go off in the alloted time
* CALLED FROM: Process_Data_From_Master_uP
* ARGUMENTS:
* Argument Type Description
* -------- ------ -----------
* Seconds int It is Miliseconds
* RETURNS: void
* NOTES: I don't care, I mean who gives a crap anyway? I figure if you're looking at this
You probably want to know what this does, but if you dont already know what
This does, you didn't program it and if you didn't program it
Then you're probably not a programmer who wouldn't understand
this stuff anyway right? Right.
************************************************** *****************************/
void SetAlarm(int Seconds)
{
// Alarm = RobotTime + Seconds;
}
/************************************************** *****************************
* FUNCTION NAME: Manual399
* PURPOSE: What the robot does in Manual Mode
* CALLED FROM: Process_Data_From_Master_uP
* ARGUMENTS: void
* RETURNS:
* Returns Descriptionuser_Routines_Fast
* -------- -----------
* 1 Alarm has fired
* 0 Has not reached the Alarm
* NOTES: I don't care
************************************************** *****************************/
int CheckAlarm(void)
{
// int flag = 0;

// if(RobotTime >= Alarm)
// flag = 1;

// return flag;
}
/************************************************** *****************************
* FUNCTION NAME: Autonomous399
* PURPOSE: What the robot does in Autonomous Mode
* CALLED FROM: User_routines_Fast/User_Autonomous_Code()
* ARGUMENTS: void
* RETURNS: void
* NOTES: Well if you have a pole one light year long and you pull on it
does the other side take a whole year to move or does it move right away?
If it moves right away then there is something out there that
moves faster than the speed of light, but didn't Einstein say that
the speed of light is the universal speed limit?
************************************************** *****************************/
void Autonomous399(void)
{
switch(dip_switch())
{
// case 1: Auto1_Shoot(); break;
// case 2: Auto2_Dump(); break;
// case 3: Auto3_(); break;
case 4: break;//DO NOTHING
}
}
/************************************************** *****************************
* FUNCTION NAME: dip_switch
* PURPOSE: turn dip switches to #s 1-4
* CALLED FROM:
* ARGUMENTS: void
* RETURNS:
* Switches Outcomes
* ----------- -----------
* 0 0 1
* 1 0 2
* 0 1 3
* 1 1 4
* NOTES: I don't care
************************************************** *****************************/
int dip_switch(void)
{
int dip;
dip = (4*digital_io_01) + (2*digital_io_02) + digital_io_03;
return dip;
}

/************************************************** *****************************
* FUNCTION NAME: Auto1_Shoot
* PURPOSE: What the robot does in Autonomous Mode
* CALLED FROM: User_routines_Fast/User_Autonomous_Code()
* ARGUMENTS: void
* RETURNS: void
* NOTES: Yeah, so a C++ programmer from Apple walks into a bar and says
"Bartender can I have a soda and soda on the rocks?" and the
Bartender says, "Soda and soda, that doesnt make any sense mister."
and the programmer says, "whoops, looks like I took a ring zero exception
fault on an illegal instruction in the old CPU huh?"
************************************************** *****************************/
/*void Auto1_Shoot(void)
{
// TimerUpdate();
switch(AutoState)
{
case 1:
// SetAlarm(1500);
AutoState = 2;
break;
case 2:
pwm04 = pwm05 = pwm06 = pwm07 = 200;
pwm08 = pwm09 = motor03 + MOTORSTEP;
if(CheckAlarm()1)
{
pwm04 = pwm05 = pwm06 = pwm07 = 127;
AutoState= 3;
}
break;
case 3:
if(Center_On_Goal() == 1)
{
AutoState = 4;
}
break;
case 4:
if(MoveInOnGoal() == 1)
{
AutoState = 5;
}
break;
case 5:
pwm08 = pwm09 = pwm10 = pwm11 = 254;

break;
}
}
/************************************************** *****************************
* FUNCTION NAME: Auto2
* PURPOSE: What the robot does in Autonomous Mode
* CALLED FROM: User_routines_Fast/User_Autonomous_Code()
* ARGUMENTS: void
* RETURNS: void
* NOTES: Are you still seriously reading these things? If you want the notes
you'll have to go to class yourself, I am tired of pulling your
weight around here, seriously, next time you're absent I'm not taking
the notes for you.
************************************************** *****************************/
/*void Auto2_Dump(void)
{
motor03 = pwm09 = pwm08;
// TimerUpdate();
switch(AutoState)
{
case 1:
// SetAlarm(800);
AutoState = 2;
break;
case 2: //Turn Right .8s
pwm04 = pwm05 = 254;
pwm06 = pwm07 = 0;
pwm08 = pwm09 = motor03 - MOTORSTEP;
if(CheckAlarm())
{
pwm04 = pwm05 = pwm06 = pwm07 = 127;
// SetAlarm(1500);
AutoState = 3;
}
break;
case 3: //go forward 1.5s
pwm04 = pwm05 = pwm06 = pwm07 = 254;
if(CheckAlarm()1)
{
pwm04 = pwm05 = pwm06 = pwm07 = 127;
AutoState = 4;
}
break;
case 4: //DUMP
pwm08 = pwm09 = 0;
relay1_fwd = 1; //Open Door
break;
}
}
/************************************************** *****************************
* FUNCTION NAME: Auto3_
* PURPOSE: What the robot does in Autonomous Mode
* CALLED FROM: User_routines_Fast/User_Autonomous_Code()
* ARGUMENTS: void
* RETURNS: void
* NOTES: David's.
************************************************** *****************************/
/*void Auto3_(void)
{

motor03 = pwm09 = pwm08;
// TimerUpdate();
switch(AutoState)
{
case 1:
// SetAlarm(10000);
AutoState = 2;
break;

case 2:
pwm04 = pwm05 = pwm06 = pwm07 = 254;//floor it!//
if(CheckAlarm())
{
AutoState = 0;
pwm04 = pwm05 = pwm06 = pwm07 = 127;
}
break;
}
}
*/
Give credit where it's due! (me by the way)
__________________
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Stay with me here...

Everyone knows that Time = Money and Knowledge is power right? It is also known that Power = Work / Time. So then we substitue Power and time so Knowledge = Work / Money. Then we solve for money and get that Money = Work / Knowledge. So, As Knowledge approaches 0, the more money is made regardless of how much work is done.

Now we know that the less you know the more money you make, even with close to no work!
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;