blueroomelectronics
Well-Known Member
I'm writing a module in Swordfish BASIC for the Mongoose robot kit. I've looked at the now discontinued Micro-Bot's PICBasic Pros "MotorDir" command for controlling a pair of servo motors.
Here's what I've come up with.
where:
lm = +/-1023 (sets left motor direction & 10bit PWM directly)
rm = +/-1023 (sets right motor direction & 10bit PWM directly)
offset = +/- 127 (subtracts from lm + and rm -) corrects motor difference
Also I'm trying to figure out a syntax for the wheel rotation sensors. Two integer variables +/- 32767 (approx +/-50m on the Mongoose) will be automatically updated using Swordfish's interrupt on change module.
Any suggestions?
Here's what I've come up with.
Code:
MotorLR(lm,rm,offset)
lm = +/-1023 (sets left motor direction & 10bit PWM directly)
rm = +/-1023 (sets right motor direction & 10bit PWM directly)
offset = +/- 127 (subtracts from lm + and rm -) corrects motor difference
Also I'm trying to figure out a syntax for the wheel rotation sensors. Two integer variables +/- 32767 (approx +/-50m on the Mongoose) will be automatically updated using Swordfish's interrupt on change module.
Any suggestions?