0

DRV2605L as secondary I2C device?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

DRV2605L as secondary I2C device?

by nolonger_superman on Thu Aug 15, 2019 10:31 am

First off, sorry if this is the wrong sub forum! I'm new to tinkering and working on a prop(a Pokeball from Pokemon) for my daughter's halloween costume.

I purchased an MPU-6050 Gyroscope from Amazon (so understand if you can't support me here) that can support another I2C device as a slave via the "XDA" and "XCL" pins. So on the DRV2605L(purchased here), I connected the SCL to the gyro XCL and SDA to the gyro XDA pins. Then I connected the DRV2605L VIN to my Pi0W 3.3V pin and GND to Pi GND pin. I wrote a simple python script to vibrate a haptic motor (purchased here). I believe I have everything set up / installed properly(more on that soon).

So when I have things connected as described above, the gyro works and I can view the sensor data; however, the Haptic controller doesn't seem to do anything.

When I disconnect the Gyro and hook the DRV2605L directly to the pi and SCL/SDA pins, I can get the motors to vibrate so it obviously works.

Any thoughts or ideas on what I can try to get the DRV2605L working as a "slave" I2C device? Would I need to dig in to the driver code and update something? Is there a way to say whether it's coming directly from the GPIO or another device?
Attachments
hapticpy-code.jpg
hapticpy-code.jpg (112.8 KiB) Viewed 47 times
haptic-error.jpg
haptic-error.jpg (203.02 KiB) Viewed 47 times

nolonger_superman
 
Posts: 3
Joined: Thu Aug 15, 2019 10:09 am

Re: DRV2605L as secondary I2C device?

by adafruit_support_bill on Thu Aug 15, 2019 10:46 am

I don't know the specs of your MPU-6050 or how to talk to it's 'slave' i2c bus. But i2c is a bus architecture. It is designed to support multiple devices. If you connect your DRV2605 directly to the i2c bus on the Pi, you should be able to talk to both devices - as long as they have different i2c addresses.

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: DRV2605L as secondary I2C device?

by nolonger_superman on Thu Aug 15, 2019 11:05 am

Thanks for the reply. I am a bit confused though. How would I connect multiple I2C devices directly? Sorry if it's such a basic question. Would I have to splice the wires going to the SDA and SCL pins on the pi?

Edit: And if I do just "splice" the wires, is there a cleaner way to do it then literally splicing? I'm using header pins with the appropriate connectors right now.

nolonger_superman
 
Posts: 3
Joined: Thu Aug 15, 2019 10:09 am

Re: DRV2605L as secondary I2C device?

by adafruit_support_bill on Thu Aug 15, 2019 11:10 am

You can splice the wires. Or use a Pi Cobbler and solderless breadboard so you can make multiple connections to the same signal.
https://www.adafruit.com/product/914

adafruit_support_bill
 
Posts: 74337
Joined: Sat Feb 07, 2009 10:11 am

Re: DRV2605L as secondary I2C device?

by nolonger_superman on Thu Aug 15, 2019 11:20 am

Excellent! Thank you so much. I have a while until Halloween so I'll keep poking around for an answer elsewhere. That said, you've been super helpful on something not purchased here, so that goes a long way to improving customer goodwill. I'll definitely be buying other things here in the future!

nolonger_superman
 
Posts: 3
Joined: Thu Aug 15, 2019 10:09 am

Please be positive and constructive with your questions and comments.


cron