Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Template Project (http://www.chiefdelphi.com/forums/showthread.php?t=28839)

Astronouth7303 29-05-2004 13:00

Template Project
 
I'm making a Template Project. What do you want in it?

Astronouth7303 29-05-2004 13:12

Re: Template Project
 
Here's my list:
  • Kevin's Interupts.c
  • TTL support (Flag to redirect Printf()s to TTL?)
  • Variables.c/.h
  • multiple autons
  • flags.h
    Code:

    #define __NO_PRINTF_
    #define __EDU_RC_
    #define __USE_TTL_
    //etc...

  • sgn, abs, absdif (macros, math.h)
    Code:

    #define sgn(Number) ( (0 - ((Number) < 0)) || ((Number) > 0) )
    #define abs(Number) ( ((Number) < 0) ? (0 - (Number)) : (Number) )
    #define absdif(Num1,Num2) ( ((Num1) < (Num2)) ? ((Num2) - (Num1)) : ((Num1) - (Num2)) )

  • EDU & FRC (flag)
  • // C++ style Comments
  • main.c bug fixed
  • Botalias.h
  • Kevin's EDU RC code?
  • DoData macro.
    Code:

    #define DoData ( (statusflag.NEW_SPI_DATA) ? (Getdata(&rxdata) | Putdata(&txdata)) : 0)

mtrawls 29-05-2004 13:24

Re: Template Project
 
Quote:

Originally Posted by Astronouth7303
I'm making a Template Project. What do you want in it?

You might add some debug/test routines. E.g.,

Code:

Set_Debug_Level (HIGH); // or maybe Set_Debug_Level (5), etc.
...
debug (msg, threshold); // i.e., if debug level < threshold, print msg
eq (some_var, some_val, severity); // i.e., if some_var!=some_val do action based on severity
// etc., more tests/debug features

Just a thought ... it's nice sometimes to write code based on certain tests, and since you don't always have the robot with you while coding, it can be helpful to print out errors where something unexpected occurrs, but then have it go silent when you are doing the competition ... but still have it ready to go if you change something and need to make sure it all works. Wow, I'm going to stop rambling now.

Astronouth7303 29-05-2004 13:31

Re: Template Project
 
No, no. that's the point. And it's better than mine, I think.

Kevin Watson 30-05-2004 02:49

Re: Template Project
 
Quote:

Originally Posted by Astronouth7303
Here's my list:
  • TTL support (Flag to redirect Printf()s to TTL?)

This would be kinda cool. Can I suggest that you look into adding a circular buffer too? For extra credit, how about making it interrupt driven?

-Kevin

Astronouth7303 30-05-2004 09:08

Re: Template Project
 
Quote:

Originally Posted by Kevin Watson
This would be kinda cool. Can I suggest that you look into adding a circular buffer too? For extra credit, how about making it interrupt driven?

-Kevin

"Gah!" -JVN

I'll see what I can do...

wun 30-05-2004 14:06

Re: Template Project
 
Something to make tweaking variables easer would be really nice (you know, for those situations where you need to get the deadzone on the joystick just right or tweak the speed so the right motor goes a little slower).

Max Lobovsky 30-05-2004 17:13

Re: Template Project
 
Quote:

Originally Posted by wun
Something to make tweaking variables easer would be really nice (you know, for those situations where you need to get the deadzone on the joystick just right or tweak the speed so the right motor goes a little slower).

Some teams created a command prompt, via a terminal program, to change constants and make other changes to the robot without uploading new code.

Astronouth7303 30-05-2004 19:08

Re: Template Project
 
Quote:

Originally Posted by maxlobovsky
yeah, like a little mini command prompt that some teams use.

I don't know what your talking about, but this is entirely within the standard MPLAB project. So add:
  • Interpret_Data()
for checking that sort of thing. The challenge is making it extremely flexible and general, yet doing that sort of thing easily, W/O BLOAT.

wun 30-05-2004 20:04

Re: Template Project
 
Quote:

Originally Posted by maxlobovsky
Some teams created a command prompt, via a terminal program, to change constants and make other changes to the robot without uploading new code.

Thats a really good idea! How is it done? Do you know where I can take a look at the code?

Max Lobovsky 30-05-2004 20:05

Re: Template Project
 
Well by some teams, i only meant one specific example, but I'm sure there are more. Let me see if I have can get permission to post the relevant part of the code.


All times are GMT -5. The time now is 19:59.

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