View Single Post
  #5   Spotlight this post!  
Unread 14-01-2007, 20:52
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: PWM 13-16 Replacement Code Beta Test

Quote:
Originally Posted by Noah Kleinberg View Post
Is there any reason that you couldn't use "int"s to store your motor speeds and have a greater range of values with the higher precision obtained by using the CCP (that is, instead of using the gain and center #defines)? I looked through the code and don't see why this wouldn't work, what i mean is something like this as a change to the PWM() function...
Yes, certainly! I didn't do it that way because I wanted backward compatibility with Generate_Pwms(). You could have any units you want, even degrees. Cool, eh?


Quote:
Originally Posted by Noah Kleinberg View Post
Also, could CCPR1L and CCPR1H (or 2-5) each be 255? I ask this because with the default GAIN and CENTER values, the maximum I believe is 21400 (that is for the two combined as one word), as opposed to 65535.
Sure, but having pulses as long as 6.5535 ms doesn't do you much good when controlling servos and victors, which want to see inputs ranging from about 1ms to 2ms.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org