Join GitHub today
I2C address 0x30 is unchangeable #3
By hardware design, the motor shield allows selecting one of four i2c addresses (0x2d, 0x2e, 0x2f , 0x30) by soldering connection between relevant pads (AD0, AD1) on the shield.
At the moment, the alternative firmware has 0x30 as a hard-coded address, which does not allow using of more then one shield in the project.
There are 2 possible solutions I can think of:
It should be easy for you, as you already have the compilation toolchain installed.
Here are the lines from the original firmware source code that may be helpful:
#define AD0_Pin GPIO_PIN_0
hi2c1.Init.OwnAddress1 = i2c_base_add<<1;
I had no patience, so I installed the toolchain, patched the value of 0x60 (2 * 0x30) in main.c to suit addresses 0x2d, 0x2e, 0x2f , 0x30, compiled firmware for each address, flashed and tested with motor shield.
Now it's possible to use more than one motor shield at once.
Attached is the zip with firmware files for 4 different addresses.
I have a branch to fix the firmware to use the solder pads on the back here: https://github.com/NathanJPhillips/wemos_motor_shield/commits/feature/address-select