LATEST VERSION 1.0 (22.02.2012)

Description

Module to handle pads, joysticks, etc., based on SDL library (LINK). Tested with Logitech Attack 3D, Logitech Extreme, wireless Sony PS3 Sixaxis. 

joysticks

Module functions

UJoystick.new(0); - start joystick ID 0
UJoystick.name; - name of the hardware, useful if you are using multiple joysticks
UJoystick.axis0; - axis 0 slot
UJoystick.axis1; - axis 1 slot

UJoystick.button0; - button 0 slot
UJoystick.button1; - button 1 slot

UJoystick.hat0; - hat 0 slot
UJoystick.hat1; - hat 1 slot

UJoystick.ball0; - ball 0 slot
UJoystick.ball1; - ball 1 slot

Urbiscript example

loadModule("UJoystick"); // set up joystick 0, you can use multiple joysticks
var joystick=UJoystick.new(0); // the module automatically adds axis, buttons, hats, and balls slots according to your hardware
joystick.button0;
joystick.axis0;
joystick.hat0;
joystick ball0; 
// configure action for joystick buttons, axes, etc.
if (joystick.name=="Logitech Attack 3D"){
   // configure axis 0
   joystick.&axis0.notifyChange( closure() { robot.body.yaw.speed=joystick.axis0; });
   // configure button 0
   joystick.&button0.notifyChange( closure() { if (joystick.button0 == 1 ) robot.body.neck.head.Say("Hello. My name is robot"); });
};

Download

LINK

 

 

EMYS and FLASH are Open Source and distributed according to the GPL v2.0 © Rev. 0.8.0, 27.04.2016

FLASH Documentation