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
ingenico_protocol edited Revision 10. Comment: removing unnecessary word
gungan37 edited Revision 6. Comment: Removed un-needed hyphen
gungan37 edited Revision 5. Comment: Minor edit to the code
Liam McSherry edited Revision 4. Comment: Fixed some spelling mistakes I didn't notice.
Liam McSherry edited Revision 3. Comment: Cleaned up the post and added some headers.
Great contribution, Gungan! Thanks for getting us started!