View Single Post
  #8   Spotlight this post!  
Unread 21-09-2003, 13:24
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
A few things:

a) NEVER EVER EVER EVER EVER set a PWM to 255. EVER! As
Damian Manda said, sending two 255's in a row will cause the RC to think that all bytes following it are the start of a new Serout command. Thus, what should have been output to PWM5, for example, may end up being interpreted as relayA, causing stuff to go massively haywire.

b) The "wrapping" of numbers isn't really an issue here. PWMs are stored as bytes (8 bits), so they can have 256 values (0-255). It's just that 255 means something else...

c) For you power freaks out there that are concerned about not getting that extra 1/256 of an output to your speed controllers, don't be! The Victors interpret anything above about 240 to be full ahead and anything below about 17 (IIRC) to be full reverse. The only even semi-real disadvantage to not being able to use 255 is that you'll loose 1/256th of a rotation on your servo.

-Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php