|
Does your program make proper accomodations for integer math and byte overflow?
I've been having trouble with a bit of code that I wrote for a throttle. When placed on the robot, it does not work at all. When placed in RoboEmu, it works just as I expected. There must be some difference between the PC emulator and the PBASIC chip that I'm not noticing. The weird part is that it works on the emulator and not on the robot (instead of the other way around). Any help?
The code is as follows:
LDRILL = ((LDRILL * p1_wheel) / 255) + ((255 - p1_wheel) / 2)
RDRILL = ((RDRILL * p1_wheel) / 255) + ((255 - p1_wheel) / 2)
LDRILL and RDRILL are both variables of byte length.
|