A blog on novel user interfaces, mobile applications, pervasive and ubiquitous computing. I use the blog as a note pad ;-)

Saturday, 19 March 2011

WP7 Tutorial - part 2: Vibration

This examples shows how to activate the vibration motor / vibration actuator in the phone. The calls Microsoft.Devices.VibrateController.Default.Start and Microsoft.Devices.VibrateController.Default.Stop are used to switch the actuator on and off.When switching the vibration on the parameter sets the duration for which it should be on. The duration is between 0 and 5 seconds. With the function TimeSpan.FromMilliseconds(duration), where duration is a number, the parameter can be set easily.

The standard API only supports to switch on and off the vibration. We experimenting with the code you can explore how to have vibrations of different intensity. To do this you have to switch on and off the vibration (e.g. 100 ms on then 50 ms off) - basically doing pulse-width modulation.