Much like controlling the LEDs it’s very easy to get the motor in the Kinect moving around, it has a range from +30 to -30 degrees from it’s central position. The motor is known to be very fragile so it’s best to keep track that you’re not trying to go over this and make sure you never try and physically force the motor into a position, the gears will probably snap.
The function call freenect_set_tilt_degs is the function you’re going to want to move to set the angle of the motor, it again takes two parameters, the device and the angle.
Inputs:
dev – Kinect to set tilt
angle – Angle of tilt
Returns:
0 – Successful,
< 0 – Failed.
Example use:
if (key == ‘w’)
freenect_angle ++;
//Check that the motor isn’t trying to go out of it’s range, if it is set it to max (30)
if( freenect_angle > 30)
{
freenect_angle = 30;
}
//Tilt downwards on a key press of s
if (key == ‘s’)
freenect_angle –;
//Check that the motor isn’t trying to go out of it’s range, if it is set it to min (-30)
if( freenect_angle < -30)
{
freenect_angle = -30;
}
//Set the angle the kinect should tilt to.
freenect_set_tilt_degs( f_dev, freenect_angle );
More information – here

