Пример #1
0
// Tells the device to update it's state data. If you're going to be reading values off the device,
// it's really necessary to be calling this function on a draw/game loop or go routine, otherwise the data will be stale.
func (tilt *Tilt) Refresh() {
	C.freenect_update_tilt_state(tilt.device.dev)
	state := C.freenect_get_tilt_state(tilt.device.dev)

	tilt.Angle = float32(C.freenect_get_tilt_degs(state))
	tilt.Status = int(C.freenect_get_tilt_status(state))
	var x, y, z C.double
	C.freenect_get_mks_accel(state, &x, &y, &z)
	tilt.AccelX = float32(x)
	tilt.AccelY = float32(y)
	tilt.AccelZ = float32(z)
}
Пример #2
0
//FREENECTAPI freenect_tilt_status_code freenect_get_tilt_status(freenect_raw_tilt_state *state);
func (state *RawTiltState) GetTiltStatus() TiltStatusCode {
	return TiltStatusCode(C.freenect_get_tilt_status(state.ptr()))
}
Пример #3
0
// GetTiltStatus returns the current status of the tilting motor.
func (device *Device) GetTiltStatus() TiltStatus {

	tiltState := C.freenect_get_tilt_state(device.device)

	return TiltStatus(C.freenect_get_tilt_status(tiltState))
}
Пример #4
0
func (d *FreenectDevice) GetTiltStatus(ts TiltState) TiltStatusCode {
	return TiltStatusCode(C.freenect_get_tilt_status(ConvertGoTiltStructToC(ts)))
}