Haptic module

The PyMetaWear implementation of the libmetawear haptic module.

It is initialized at the creation of the MetaWearClient client and can then be accessed in the haptic attribute of the client.

Example usage:

from pymetawear.client import MetaWearClient

c = MetaWearClient('DD:3A:7D:4D:56:F0')

# Activate the Haptic motor.
c.haptic.start_motor(100, 500)

# Activate the Haptic buzzer.
c.haptic.start_buzzer(500)

API

Haptic module

Created by hbldh <henrik.blidh@nedomkull.com> on 2016-04-14

class pymetawear.modules.haptic.HapticModule(board)[source]

MetaWear Haptic module implementation.

Parameters:
  • board (ctypes.c_long) – The MetaWear board pointer value.
  • debug (bool) – If True, module prints out debug information.
module_name

Get module name.

Returns:The name of this module.
Return type:str
notifications(callback=None)[source]

No subscriptions possible for Haptic module.

Raises:PyMetaWearException
start_buzzer(pulse_width_ms)[source]

Activate the haptic buzzer.

Parameters:pulse_width_ms (int) – How long to run the motor, in milliseconds
start_motor(duty_cycle_per, pulse_width_ms)[source]

Activate the haptic motor.

Parameters:
  • duty_cycle_per (float) – Strength of the motor, between [0, 100] percent
  • pulse_width_ms (int) – How long to run the motor, in milliseconds