[HELP] Homemade oculus rift

Official forum for open source FreePIE discussion and development.
Post Reply
GassTonJc
One Eyed Hopeful
Posts: 2
Joined: Mon Dec 16, 2013 10:15 am

[HELP] Homemade oculus rift

Post by GassTonJc »

Well was in the process with my Oculus Rift home and have as sensor movement by WiiMote, wanted to know I do so I can move the mouse with FreePie is to be connect with Bluetooth, I did that already, but with freepie someone tells me to do?

thanks in advance

I use Google Translator, im from argentina
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: [HELP] Homemade oculus rift

Post by CyberVillain »

You want to use your Wiimote with freepie?

This is a good script to start with for Wiimotes (It requires motion plus)

Code: Select all

def log_motionplus():
	diagnostics.watch(wiimote[0].ahrs.yaw)
	diagnostics.watch(wiimote[0].ahrs.pitch)
	diagnostics.watch(wiimote[0].ahrs.roll)
	
def simulate_mouse_pointer():	
	mouse.deltaX = filters.deadband(filters.delta(wiimote[0].ahrs.yaw), 0.1) * 10
	mouse.deltaY = filters.deadband(-filters.delta(wiimote[0].ahrs.pitch), 0.1) * 10
	
def log_nunchuck():
	diagnostics.watch(wiimote[0].nunchuck.acceleration.x)
	diagnostics.watch(wiimote[0].nunchuck.acceleration.y)
	diagnostics.watch(wiimote[0].nunchuck.acceleration.z)
	diagnostics.watch(wiimote[0].nunchuck.buttons.button_down(NunchuckButtons.Z))

def simulate_mouse_press():
	mouse.leftButton = wiimote[0].nunchuck.buttons.button_down(NunchuckButtons.Z)

if starting:
	system.setThreadTiming(TimingTypes.HighresSystemTimer)
	system.threadExecutionInterval = 2
	
	wiimote[0].motionplus.update += log_motionplus
	wiimote[0].motionplus.update += simulate_mouse_pointer
	wiimote[0].nunchuck.update += log_nunchuck
	wiimote[0].nunchuck.update += simulate_mouse_press
	
	wiimote[0].enable(WiimoteCapabilities.MotionPlus | WiimoteCapabilities.Extension)
Post Reply

Return to “FreePIE”