Quote:
|
Originally Posted by TubaMorg
Another idea I had was to maintain my drive variables as int to avoid overranging and then of course make sure they are 0-254 before sending them to the PWM ports. That way if there is any spurious or temporary overranging, I won't lose control of the variable. Because no matter how you look at it, if you take and unsigned char with a value > 127 and add 127, then you have over ranged even though subsequent operations are designed to bring it back into range. With ints this shouldn't be a problem right? Unless I really, really really, go out of range.
|
Yep. with a signed int, you can go on the range: [-32768, 32767].