Adding vibration to my missed call alert program (S60)

Used Symbian's HW Resource Manager Vibra API to control the vibrator.

First, include the header and declare a member variable in the application class:
#include <hwrmvibra.h>
. . . . . .
CHWRMVibra* iVibra;

In the 2nd phase constructor, create the instance:
......
iVibra = CHWRMVibra::NewL();
......

Start the vibrator when necessary:
......
// vibrate for 5 sec, strongest intensity
iVibra->StartVibraL(5000, 100);
......

And remember to destroy it in destructor:
......
if (iVibra)
{
    delete iVibra;
    iVibra = NULL;
}
......

This entry was posted on Tue, 04 Sep 2007 16:46:00 GMT and Posted in . You can follow any any response to this entry through the Atom feed. You can leave a comments, .


Comments

Leave a response

Leave a comment