start:
JoystickForSmallBasicAdvanced.Acquire()
TextWindow.Title =
"Joystick Information"
TextWindow.WriteLine(
""
)
"Axis position: "
+ JoystickForSmallBasicAdvanced.GetX() +
", "
+ JoystickForSmallBasicAdvanced.GetY() +
+ JoystickForSmallBasicAdvanced.GetZ())
slider = JoystickForSmallBasicAdvanced.GetSlider(0)
'get slider #0 value
slider = (slider / 65536) * 100
'convert to a percentage (go from out of 65536 to out of 100)
slider = 100 - slider
'flip value (DirectX gives value backwards)
"Slider position: "
+ Math.Round(slider) +
"%"
"POV hat position: "
+ JoystickForSmallBasicAdvanced.GetPOV(0) +
"°"
"Firmware revision: "
+ JoystickForSmallBasicAdvanced.FirmwareRevision)
TextWindow.Write(
"Buttons: "
For
i = 0
To
(JoystickForSmallBasicAdvanced.ButtonCount - 1)
'since buttons start with zero
If
JoystickForSmallBasicAdvanced.GetButton(i) =
"True"
Then
" "
+ i +
EndIf
EndFor
Program.Delay(120)
'delay so user can read info
TextWindow.Clear()
Goto start
Great contribution, Gungan! Thanks for getting us started!