drv2605 external trigger mode

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mofuzz
 
Posts: 5
Joined: Fri May 15, 2015 2:50 pm

drv2605 external trigger mode

Post by mofuzz »

Hello,

Can anyone please share an example of how to use the drv2605 haptic controller board in external trigger mode using the "in" pin being driven by a digital output?

Can I use the board without it being connected to I2C?

Thanks.

User avatar
mikeysklar
 
Posts: 14165
Joined: Mon Aug 01, 2016 8:10 pm

Re: drv2605 external trigger mode

Post by mikeysklar »

You will need the i2c connection to set the mode of the chip.

Do you know which of trigger mode you would like to use? I'm guessing MODE_EXTTRIGEDGE or MODE_EXTTRIGLVL based on your description of a digital in.

Code: Select all

The mode of the chip. Should be a value of:

MODE_INTTRIG: Internal triggering, vibrates as soon as you call play(). Default mode.

MODE_EXTTRIGEDGE: External triggering, edge mode.

MODE_EXTTRIGLVL: External triggering, level mode.

MODE_PWMANALOG: PWM/analog input mode.

MODE_AUDIOVIBE: Audio-to-vibration mode.

MODE_REALTIME: Real-time playback mode.

MODE_DIAGNOS: Diagnostics mode.

MODE_AUTOCAL: Auto-calibration mode.
https://docs.circuitpython.org/projects ... t/api.html

User avatar
mofuzz
 
Posts: 5
Joined: Fri May 15, 2015 2:50 pm

Re: drv2605 external trigger mode

Post by mofuzz »

Thanks for your reply.

Yes, I was thinking of MODE_EXTTRIGEDGE.

User avatar
mikeysklar
 
Posts: 14165
Joined: Mon Aug 01, 2016 8:10 pm

Re: drv2605 external trigger mode

Post by mikeysklar »

I don't have a working example code for MODE_EXTTRIGEDGE, but You should be able to pass in the value during initialization.

Code: Select all

drv = adafruit_drv2605.DRV2605(i2c, MODE_EXTTRIGEDGE)
more info here:

; docs
https://docs.circuitpython.org/projects ... it_drv2605

; driver source
https://github.com/adafruit/Adafruit_Ci ... 605.py#L92

; datasheet
https://www.ti.com/lit/ds/symlink/drv2605.pdf

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”