Have your Arduino count motor encoder rotations. Connect the Arduino to your EZ-B UART #0 port to send the encoder counts.
This tutorial uses the following controls:Sabertooth Serial 4 Wire HBridge PWM Script HBridge
There are two sets of wires which will need to be connected:
1) The Arduino to the encoder
2) The Arduino to the EZ-B
Connect the encoder wires to your Arduino pins 2 and 3. These pins are interrupt pins. The code will count the number of changes between HIGH and LOW state of these pins.
- pin 2: Encoder #1
- pin 3: Encoder #2
Connect the Arduino's TX and RX ports to the UART #0 of the EZ-B. Consult the ez-b datasheet to locate the UART #0 port.
- Connect EZB UART 0 TX to ARDUINO RX
- Connect EZB UART 0 RX to ARDUINO TX
- Connect Arduino GND to EZ-B GND