User Tools

Site Tools


asi_gamepad

ASI Gamepad

ASI Gamepad is a MicroManager plugin that adds support for an XBox Gamepad. It lets users assign device properties to thumb sticks and Beanshell scripts to button presses.

ASI Gamepad

Requirements

  • MicroManager version 1.4.23
  • OS Windows 7 and above
  • Gamepads supported, Xbox One controller(tested), XBox 360 controller (not tested)

Gamepad Layout

XBox gamepad layout
  1. Right Thumbstick X/Y
  2. Directional pad or DPAD
  3. Left Thumbstick X/Y
  4. Back button
  5. Left shoulder button
  6. Left trigger
  7. Home button
  8. Start button
  9. Right trigger
  10. Right shoulder button
  11. Y,B,A,X buttons

Plugin GUI explained

Gamepad Status

Gamepad status

The controller/gamepad isn't added thru the hardware config wizard , instead the plugin when launched looks for it. Then it displays the message “GamePad:NOT Found”,“..FOUND”,“..Connecting” and “..Error Connecting” accordingly.

A good guide on pairing your xbox Gamepad to PC is here

If you already have the gamepad paired, press the HOME button. The button lights up, blinks a few times and once its connected to the PC it glows solid. Moments later the plugin will update the status to “GamePad:Found”

Save and Load Buttons

Save and Load button

The button and joystick assignments aren't automatically saved by the plugin between session , so use these buttons to save and load all thumb stick and button assignments.

Axis Assignment Table

Axis assignment tbale

Axes are analog controls on the gamepad.

  • The Two thumb sticks return a decimal point value between +1 to -1.The thumb sticks also have two axis each X and Y.
  • The triggers return a decimal point value between 0 to +1.
  • The DPAD can be read both as a button or axis , it returns a value of “-1” when not pressed. “1” when Up is pressed, “3” when right is pressed, “5” when down is pressed and “7” when left is pressed.

Using the axis assignment table user can pick a device and device property that is adjusted when the axis is moved.

A common use of these controls is to move a stage. For this assign the axis to a stage's vector move property. In the case of an ASI's XYstage the property “VectorMoveX-VE(mm/s)” and “VectorMoveY-VE(mm/s)” are appropriate. They accept input in mm/sec and typical max value for the property is 4-5mm/sec. So here the multiplier column comes handy, when a multiplier of 3 is picked. Then the thumbstick deflection which varies from +1 to -1 , turns into +3 to -3 , and when applied to the device property , the stage will move +3 mm/sec to -3 mm/sec.

Button Assignment Table

Button assignment table

Unlike the axes controls, buttons have only two states, pressed or unpressed. The Action column of the Button assignment table lets user pick from a list of predefined actions (like Snap, Live view toggle etc) or “Run_Beanshell_script” to specify a beanshell script to be run on the button press. The path to the script is specified with the 3rd column. Clicking on it displays a File Chooser dialog box and user can navigate and pick the script to run.

A common way to setup the DPAD would be to move a stage on presses. For this make 4 different beanshell scripts with the following codes gui.setRelativeXYStagePosition(X# in um,Y# in um); each with a different move and assign them to the DPAD buttons like this:

gui.setRelativeXYStagePosition(1000,0);

gui.setRelativeXYStagePosition(-1000,0);

gui.setRelativeXYStagePosition(0,1000);

gui.setRelativeXYStagePosition(0,-1000);

For example scripts click here

asi_gamepad.txt · Last modified: 2019/04/18 23:33 (external edit)