Wemos D1 Mini & Motor Shield - Noob can't get it to work

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
marcexec
Posts: 4
Joined: Sat Oct 28, 2017 8:59 pm

Wemos D1 Mini & Motor Shield - Noob can't get it to work

Post by marcexec » Sat Oct 28, 2017 9:27 pm

Hi everyone!

I'm trying to get a simple robotics platform to work to tinker together with my 6yo daughter. MicroPython appealed to me because of the higher level and the idea for a simple robot with Python came from the lovely Laby game (bundled with QIMO).
The setup is as follows:
- 2 yellow T1 6V motors, converted to LEGO axles
- 1 Wemos D1 Mini
- 1 D1 Mini battery shield
- 1 D1 Mini motor shield
- 1 18650

Steps so far:
- Web REPL is working fine
- the stack works when battery powered (yay, this alone makes this so cool :))
- the battery is plenty when connected to the motors directly
- the buggy shield firmware is fixed thanks to Hackaday (https://hackaday.io/project/18439-motor ... rogramming) & an old Pro Mini programmer
- STBY came bridged to I2C already, RST is also enabled

REPL (as per http://micropython-on-wemos-d1-mini.rea ... ields.html):
import d1motor
from machine import I2C, Pin
i2c = I2C(-1, Pin(5), Pin(4), freq=10000)
m0 = d1motor.Motor(0, i2c)
m1 = d1motor.Motor(1, i2c)
m0.speed(5000)
m1.speed(5000)

-> neither motor turns, nothing on -5000 or some other values either

i2c.scan() returns [48], supposedly the 0x30 default address as per the jumpers on the back

Any idea what I'm doing wrong here?

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Wemos D1 Mini & Motor Shield - Noob can't get it to work

Post by deshipu » Sun Oct 29, 2017 3:08 pm

The power for the motors is separate — do you have that connected?

marcexec
Posts: 4
Joined: Sat Oct 28, 2017 8:59 pm

Re: Wemos D1 Mini & Motor Shield - Noob can't get it to work

Post by marcexec » Sun Oct 29, 2017 6:57 pm

Sorry, should have made that clear.
Yes, that's powered directly from the battery and in parallel to the battery connection of the battery shield (which charges, discharges and powers the stack just fine.

marcexec
Posts: 4
Joined: Sat Oct 28, 2017 8:59 pm

Re: Wemos D1 Mini & Motor Shield - Noob can't get it to work

Post by marcexec » Sat Nov 04, 2017 8:35 pm

Works out of the box with Arduino code example from http://forum.hobbycomponents.com/viewto ... 111&t=2132 - any ideas?

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Wemos D1 Mini & Motor Shield - Noob can't get it to work

Post by deshipu » Sat Nov 04, 2017 9:08 pm

There has been an issue reported with the documentation of that library — maybe that will help you? https://bitbucket.org/thesheep/micropyt ... s-outdated

marcexec
Posts: 4
Joined: Sat Oct 28, 2017 8:59 pm

Re: Wemos D1 Mini & Motor Shield - Noob can't get it to work

Post by marcexec » Sun Nov 05, 2017 8:59 pm

thanks, it works now with

i2c = I2C(-1, Pin(5), Pin(4), freq=100000)
m1 = d1motor.Motor(0, i2c)
m2 = d1motor.Motor(1, i2c)

what a difference a zero makes ;)

Post Reply