# startvibra()

Syntax:

    [void] sysinfo.startvibra(Int duration, Int intensity)

Description:

The `startvibra` method turns the device vibration on for the specified duration with the specified intensity (frequency).

Argument:

- `duration`:

  Duration of the vibration measured in milliseconds. The value `0` specifies that the vibration should continue indefinitely or till the hardware-imposed limit, and should be stopped with a call to the `stopvibra` method.

  `duration` argument can have the maximum value of `vibramaxduration`

Note: A device may have implementation-defined or hardware-imposed limits to the duration of the vibration feature. In such circumstances, any vibration will stop at that limit even if the duration parameter is greater than the limit or specified as infinity.

- `intensity`:

  Intensity of the vibra is in the range of -100 to 100, which shows the percentage of the vibra motor's full rotation speed. When intensity is negative, the vibra motor rotates in the negative direction. When intensity is positive, the vibra motor rotates in the positive direction.

Note: The device might have hardware-imposed limits on the supported vibra intensity values, so the actual effect might vary between different hardware.

Return value:

This method does not return a value.

Remarks:

If the vibration setting in the device's active profile is set to "off", `startvibra()` will not cause the vibration feature to vibrate. Use the `vibrasettings` property to detect whether vibration is allowed.

Example code:

    function startVibration()
    {
       // get the system defined maximum duration
       var duration = sysinfo.vibramaxduration;
       // get the system defined minimum intensity
       var intensity = sysinfo.vibraminintensity
       // start vibration
       sysinfo.startvibra(duration, intensity);
    }