40: Haptics Control
Control the haptics The first haptics action after power-on will also result in the haptics driver being initialized, leading to a calibration. If Header Duration is provided, haptics are run in DRV2605 RTP (Real Time Playback) continuous mode and automatically stopped after the specified timeout. Parameter combinations are strict: - Pattern + Intensity (optional Duration) is valid. - Driver Pattern by itself is valid. (duration is defined by the pattern and cannot be overridden) - Driver Pattern cannot be combined with Pattern, Intensity, or Duration.
Header
| Field | Name | Description | Type |
|---|---|---|---|
| 5 | Method | Request a service to be perform an action Possible values:
| uint8 |
| 7 | Duration | To be used with the SUBSCRIBE method, or actions that can be timed. When used with a timed action: This defines how long the action should go on for. When used with the SUBSCRIBE method: This defines a duration to keep the subscription active for. A value of 0 means the subscription is indefinite until explicitly unsubscribed. An ACK with EXPIRED status code will be sent if the subscription duration elapses without being renewed with a new subscription request. | uint32 |
Payload
| Field | Name | Description | Type | Unit |
|---|---|---|---|---|
| 1 | Pattern | Pattern of haptics [1-3] Possible values:
| uint8 | |
| 2 | Intensity | Intensity of haptics [0-2] Possible values:
| uint8 | |
| 3 | Driver Pattern | Direct DRV2605 ROM effect index [1-123]. Must be sent on its own (without Pattern, Intensity, or Header Duration). Possible values:
| uint8 |
Examples
Medium intensity fade
📡 Real example from RH2 ESP32 Toit on 2025-10-14This example is captured from an RH2 device as part of normal communications over I2C with the ESP32 co-processor, where Toit on the ESP32 made the request.
Medium intensity pulse
📡 Real example from RH2 ESP32 Toit on 2025-10-14This example is captured from an RH2 device as part of normal communications over I2C with the ESP32 co-processor, where Toit on the ESP32 made the request.
Mediaum intensity drop
📡 Real example from RH2 ESP32 Toit on 2025-10-14This example is captured from an RH2 device as part of normal communications over I2C with the ESP32 co-processor, where Toit on the ESP32 made the request.
Code
For convenience, the following constants can be used to reference this message type.