In4 | In3 | In2 | In1 | Function
0 | 0 | 0 | 0 | Stop/Free Wheel
0 | 0 | 0 | 1 | Motor 1 Forward
0 | 0 | 1 | 0 | Motor 1 Reverse
0 | 0 | 1 | 1 | Motor 1 Brake
0 | 1 | 0 | 0 | Motor 2 Forward
1 | 0 | 0 | 0 | Motor 2 Reverse
1 | 1 | 0 | 0 | Motor 2 Brake
So to use that on the robot, setting digital to on (1) and off (0) as follows
In4 | In3 | In2 | In1 | Function
0 | 1 | 0 | 1 | Robot Forward
1 | 0 | 1 | 0 | Robot Reverse
1 | 0 | 0 | 1 | Robot Turn Left (or right depending on motor orientation)
0 | 1 | 1 | 0 | Robot Turn Right (or left depending on motor orientation)
0 | 0 | 0 | 0 | Robot Stop
EZ-B V4 Usage
With the EZ-B V4 there is a slight difference when connecting the L298n H-Bridge up in that the Vcc pins of the V4 have the same voltage as VIn i.e. if you supply the EZ-B V4 with a 7.4v 2s LiPo battery you will get 7.4v on the Vcc pins of the EZ-B.
The L298n H-Bridge, as previously explained has a terminal for +5V which, on the EZ-B V3 was fine to supply from one of the digital ports Vcc however with the V4 this is not the case.
Rather than supply the L298n with +5V we need to not connect this terminal and press the switch on the H-Bridge so that it uses it's on board regulators to provide its own 5V from the Vcc supplied.
All other connections remain as previously explained.
Pushing this button will enable the on board regulators. When enabled it may indicate so with a red LED.
On the EZ-B side, the connections would be pretty much as previously with the exception of the Vcc. On upgrading my test bot I simply disconnected the Vcc on the H-Bridge side so that my connections wouldn't require changing.
On the H-Bridge side, connections remained the same as previously however the +5V is disconnected.
That's all there is to it. :)
Update: 17/06/2014 (or 06/17/2014 if you write your dates wrong...)
Alternative wiring for a simpler method
The connections on the L298n are simply;
Vcc = Motor Supply Positive
Gnd = Motor Supply Ground (ensure this is common if using more than one supply)
+5V = Not Connected
In1 = Digital Port Signal (i.e. D8)
In2 = Digital Port Signal (i.e. D9)
In3 = Digital Port Signal (i.e. D10)
In4 = Digital Port Signal (i.e. D11)
EnA = Digital Port Signal (i.e. D12)*
EnB = Digital Port Signal (i.e. D13)*
* EnA & EnB connections optional for speed control, If speed control is not required connect the two jumpers which come with the L298n to link EnA to the +5v pin to it's right and EnB to the +5v pin to it's left.
If combined speed control is required (i.e. one speed control for both channels) a Y-cable can be used to connect both EnA and EnB to one Digital Port Signal (i.e. D12).
No ground or Vcc from the EZ-B to the L298n is required if you have a single source for both EZ-B and L298n or if you have a common ground.
You must make sure you press the switch to enable the on board 5V regulator circuit otherwise it will not operate
Some photos (I'll change them once I get chance to edit and tidy them up but no idea when I'll get the chance so here's the unedited ones).
The L298n in it's stock state
The L298n wired power connections
The L298n wired for no speed control
The EZ-B V4 wired for no speed control
The L298n with the jumpers removed
The L298n wired for common speed control (1 PWM adjusts the speed of both channels). White wires is a Y cable, 2 to 1 with the 2 at the L298n end
The EZ-B V4 wired for common speed control (1 PWM adjusts the speed of both channels). White wire is a Y cable, 2 to 1 with the 1 at the EZ-B V4 end
The L298n wired for independent speed control
The EZ-B V4 wired for independent speed control