PRO
svorres
USA
Asked
— Edited
Resolved by DJ Sures!
I have a 2 wheeled robot running the EZ-B V4. The EZ-BV4 is driving a PWM Hbridge. Each wheel has an encoder counting the wheel pulses using an Arduino Mega 2560. My question is how can I command my robot to move a specified distance stop, and then turn 90 degrees and move another distance stop etc.
I assume I can feed the distance into the Mega2560 via Blockly, but I'm not finding the Syntax to do this.
i.e move forward 6 feet
- Set motor L and R motors to PWM 50% 2. Load 1000 clicks into Mega 2560 odometer counter, ( can I do this via UART ? ) 3. Robot moves until one of the 2 counters hits 0, then motors stop
Goto next routine. rotate platform 90 degrees right
- Set motor L PWM to 50% and reverse R to PWM 50%
- Load 450 clicks into Mega 2560 odometer counter,
- Robot moves until one of the 2 counters hits 0, then motors stop
Related Hardware EZ-B v4
Related Control
Wheel Encoder Counter
I’m guessing the firmware required for this skill plugin will work on mega: https://synthiam.com/Support/Skills/Navigation/Wheel-Encoder-Counter?id=17591
connect ARC to it and you’re golden. Follow tutorials. Follow the live hack for complete step by step details.
Thanks dj this has been resolved