Other Parts Discussed in Thread: TCA9548A,
I have one question about using this motor driver.
I connected three DRVs to TCA9548A (Multiplexer).
First DRV is connected to SD0/SC0, second one is connected to SD1/SC1, and last one is connected to SD2/SC2 like below PDF file (Please refer to it).
08302022_I2C Circuit Pilot Test Diagram.pdf
And also, I made a code to sequentially control three DRVs using Waveform Library Effects list as below :
#include <Wire.h>
#include <Sparkfun_DRV2605L.h>
#define TCAADDR 0x70
SFE_HMD_DRV2605L HMD;
void tcaselect (uint8_t i){
if(i>7) return;
Wire.beginTransmission(TCAADDR);
Wire.write(1<<i);
Wire.endTransmission();
}
void setup() {
Wire.begin();
HMD.begin();
HMD.Mode(0x00);
HMD.MotorSelect(0x86);
HMD.Library(6);
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
for (int i=0; i<4;i++){
tcaselect(i);
HMD.Waveform(0,1);
HMD.Waveform(1,0);
HMD.go();
delay(1000);
}
}
However, when I tried to run this code, sometimes third one will run that is not what I expected.
For my scenario to run this code, I want to operate DRVs from 0 to 2 in order. But when I saw that problem, I pushed the reset button several time. Finally it will run correctly.
I don't know what this problem happened.
Please let me know the solution..