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?
Wemos D1 Mini & Motor Shield - Noob can't get it to work
Re: Wemos D1 Mini & Motor Shield - Noob can't get it to work
The power for the motors is separate — do you have that connected?
Re: Wemos D1 Mini & Motor Shield - Noob can't get it to work
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.
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.
Re: Wemos D1 Mini & Motor Shield - Noob can't get it to work
Works out of the box with Arduino code example from http://forum.hobbycomponents.com/viewto ... 111&t=2132 - any ideas?
Re: Wemos D1 Mini & Motor Shield - Noob can't get it to work
There has been an issue reported with the documentation of that library — maybe that will help you? https://bitbucket.org/thesheep/micropyt ... s-outdated
Re: Wemos D1 Mini & Motor Shield - Noob can't get it to work
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
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