Stop motor/buzzer when pressing the mechanical switch

I have a coin motor connected to my board and I am already able to start the motor / buzzer for a predefined time with startMotor(float dutyCycle, short pulseWidth) / startBuzzer(short pulseWidth).

Now I would like to be able to stop the motor / buzzer as soon as the user presses the mechanical switch on the board. However, the Android API for the haptic module does not offer a method for stopping a running motor / buzzer. Is there a way how I can achieve this?

Comments

  • No, once the haptic driver starts, it will continue for the amount of time specified in the pulseWidth parameter.
  • Oona,

    If it makes sense we can add this functionality in later firmware versions.
  • edited June 2015
    @Eric, thank you for your fast reply.

    @Laura, I would be very grateful if you could add this functionality in later versions! We are planning to conduct an experiment with the device for which it is essential that the user can terminate the buzzer.
This discussion has been closed.