View Single Post
  #4   Spotlight this post!  
Unread 20-01-2008, 22:35
blaxbb blaxbb is offline
Ohio State Engineering Scholar
AKA: Brian Barrett
FRC #2331
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Vernon, New Jersey
Posts: 131
blaxbb is just really niceblaxbb is just really niceblaxbb is just really niceblaxbb is just really niceblaxbb is just really nice
Re: A New Programmer

under ///*** DEFINE USER VARIABLES AND INITIALIZE THEM HERE ***/ or at the top of any .c file

to make it easier you should define your speeds so that you can update all of your speed values without changing every single one.

you can define your speeds once and call them multiple times
Code:
#define stop 127
#define forward 200
#define reverse 50
then instead of saying
Code:
pwm01 = 200;
pwm02 = 50;
you can say
Code:
pwm01 = forward;
pwm02 = reverse;
this makes it so much easier if you need to change a value quickly (at a competition)
__________________
"Whether you think you can or think you can’t, you’re right." - Henry Ford
www.vthsrobotics.org