Log in

View Full Version : Template Project


Astronouth7303
29-05-2004, 13:00
I'm making a Template Project. What do you want in it?

Astronouth7303
29-05-2004, 13:12
Here's my list:
Kevin's Interupts.c
TTL support (Flag to redirect Printf()s to TTL?)
Variables.c/.h
multiple autons
flags.h #define __NO_PRINTF_
#define __EDU_RC_
#define __USE_TTL_
//etc...
sgn, abs, absdif (macros, math.h) #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. #define DoData ( (statusflag.NEW_SPI_DATA) ? (Getdata(&rxdata) | Putdata(&txdata)) : 0)

mtrawls
29-05-2004, 13:24
I'm making a Template Project. What do you want in it?

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


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
No, no. that's the point. And it's better than mine, I think.

Kevin Watson
30-05-2004, 02:49
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
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
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
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
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
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
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.