Sachiel7 has it pretty well correct, but I don't think (s)he (trying not to be presumptuous, here) explained the concept well enough.
To my knowledge, when you send the value 255 to a speed controller, by defining either drive_L, drive_R, or PWMn as 255, the speed controller interprets this as 0V (or 0% duty cycle), rather than +12V (100% duty cycle), which is full forward.
254 is the maximum value which you're supposed to send to a speed controller.
I just looked at the RC Reference Guide, on IFI's website, and there isn't a very descriptive explanation as to what specifically is wrong. Id est...
Quote:
Programming Problem: Basic Run Error Indicator
If after programming and resetting the Robot Controller, the BASIC RUN ERR LED is ON, then the
basic code has no output. This means that the code is not running properly. Check for errors in the
code. The BASIC RUN ERR light is controlled by the Output microprocessor.
|
So, actually, now that I think of it, if you're sending 255 as a PWM output, it (the Output microprocessor) might interpret that as the end of the SEROUT command from the BS2, and think that it's supposed to then recycle (start its sequence all over). Perhaps changing the values from 255 to 254 will do the trick.
Hope this helps, some. Good luck!