View Single Post
  #44   Spotlight this post!  
Unread 01-01-2005, 20:30
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: encoder vs. motor

Quote:
Originally Posted by Astronouth7303
I don't know how it would be bad coding practice...
Well, minimizing the number of global variables is desirable because you don't have any control over the scope of a global variable. I've been involved with a few flight projects where there weren't any globally defined variables in the flight source code.


Quote:
Originally Posted by Astronouth7303
...any variable that needs to be accessable from 2 or more different functions must be declared globally.
No, this isn't true. You can pass a pointer to the variable in the function call.
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org