So the diode will drop 0.7v of the 3.7v. The other diode was so that if there's a voltage spike when the motor is disconnected, it's soaked up in the diode. To do that, simply connect it backwards across the motor (so the band side is on motor +).
Only other thing I'd say is to connect the battery to the actual JST battery connector if at all possible. Espruino's got some circuitry to automatically switch between the JST connector and USB for power, but if you connect to the (slightly misleadingly named) 'Bat' on the pins, when you plug in USB and the battery, it'll be trying to put 4.3v into the Li-Ion battery, which is going to be bad news if it's left in for any length of time.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
That looks good - I'd wire:
4,5,6,7 as you suggested
So the diode will drop 0.7v of the 3.7v. The other diode was so that if there's a voltage spike when the motor is disconnected, it's soaked up in the diode. To do that, simply connect it backwards across the motor (so the band side is on motor +).
Only other thing I'd say is to connect the battery to the actual JST battery connector if at all possible. Espruino's got some circuitry to automatically switch between the JST connector and USB for power, but if you connect to the (slightly misleadingly named) 'Bat' on the pins, when you plug in USB and the battery, it'll be trying to put 4.3v into the Li-Ion battery, which is going to be bad news if it's left in for any length of time.