Asked — Edited
Resolved Resolved by DJ Sures!

How To Use Wheel Encoder From Blockly

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

  1. 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

  1. Set motor L PWM to 50% and  reverse R to PWM 50%
  2. Load 450 clicks into Mega 2560 odometer counter,
  3. Robot moves until one of the 2 counters hits 0, then motors stop


Related Hardware (view all EZB hardware)
EZ-B V4 by EZ-Robot
EZ-B v4/2 robot controller: dual Cortex ARM, Wi-Fi, audio/video, 24 servo/digital ports, I2C/UART, camera and Synthiam ARC control for custom robots
Wi-Fi / USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 24

Related Robot Skill (view all robot skills)
Arduino UNO wheel encoder: reads left/right ticks, provides counts, configurable ticks, wheel & pivot sizes, optional pose telemetry to ARC NMS.

ARC Pro

Upgrade to ARC Pro

Synthiam ARC Pro is a new tool that will help unleash your creativity with programming robots in just seconds!

Author Avatar
PRO
USA
#2  

Thanks dj this has been resolved