/*- Eric's Google Surf - The Sensor Bar, Wiimote, Nunchuk and Balance Board are required for full functionality. The Balance Board should be placed like a skateboard with the power button on the left side. */ var.ButtonFreezeTime = 250ms var.PointerBump = KeepDown(Pressed(Wiimote1.A),var.ButtonFreezeTime) or KeepDown(Pressed(Wiimote1.B),var.ButtonFreezeTime) Wiimote1.Led1 = true Wiimote1.HasNunchuk = true Wiimote2.BalanceBoard.LED = true Wiimote2.HasBalanceBoard = true //To check raw data input from Balance Board debug = "Connected=" + Wiimote2.HasBalanceBoard + " FL=" + var.FL + " FR=" + var.FR + " BL=" + var.BL + " BR=" + var.BR //Cursor movement if Wiimote1.PointerVisible but not var.PointerBump then mouse.x = Wiimote1.PointerX mouse.y = Wiimote1.PointerY end if //Select spot on map mouse.LeftButton = Wiimote1.A and KeepDown(Wiimote1.PointerVisible,0.5s) //Change azimuth or rotate, hold down B while Surfing Key.LeftShift = Wiimote11.B //Zoom in if Wiimote11.Nunchuk.CButton then mouse.WheelUp = true wait 30ms mouse.WheelUp = false wait 30ms end if //Zoom out if Wiimote11.Nunchuk.ZButton then mouse.WheelDown = true wait 30ms mouse.WheelDown = false wait 30ms end if //Return to North up and top down view Key.R= Wiimote11.Home //The values subtracted from the raw data will need to changed. var.FR = (Wiimote2.BalanceBoard.RawFrontRight - 4800)/1000.0; var.BR = (Wiimote2.BalanceBoard.RawFrontLeft - 7500)/1000.0; var.FL = (Wiimote2.BalanceBoard.RawBackRight - 6500)/1000.0; var.BL = (Wiimote2.BalanceBoard.RawBackleft - 5200)/1000.0; //Forward If ((var.FL + var.BL) - (var.FR + var.BR)) >2 then keyboard.Up = true wait 30ms keyboard.Up = false wait 30ms EndIf //Right If ((var.FL + var.FR) - (var.BL + var.BR)) > 2 then keyboard.Right = true wait 30ms keyboard.Right = false wait 30ms EndIf //Back If ((var.FR + var.BR) - (var.FL + var.BL) ) > 2 then keyboard.Down = true wait 30ms keyboard.Down = false wait 30ms EndIf //Left If ((var.BL + var.BR) - (var.FL + var.FR) ) > 2 then keyboard.Left = true wait 30ms keyboard.Left = false wait 30ms EndIf //Easter Egg, absolutely worthless w/o the wave file PlaySound("kr.wav") = var.Song if (Wiimote1.1) then var.Song = true wait 30000 ms var.Song = false endif if var.Song = true then if 0 = 0 then if var.led = 0 then Wiimote1.Leds = 1 endif if var.led = 1 then Wiimote1.Leds = 3 endif if var.led = 2 then Wiimote1.Leds = 6 endif if var.led = 3 then Wiimote1.Leds = 12 endif if var.led = 4 then Wiimote1.Leds = 8 endif if var.led = 5 then Wiimote1.Leds = 12 endif if var.led = 6 then Wiimote1.Leds = 6 endif if var.led = 7 then Wiimote1.Leds = 3 endif wait 100 ms var.led = (var.led + 1) % 8 endif endif