Machinekit

Machinekit

Machinekit Documentation

HAL Component — JOYHANDLE

INSTANTIABLE COMPONENTS — General

All instantiable components can be loaded in two manners

Using loadrt with or without count= | names= parameters as per legacy components
Using newinst, which names the instance and allows further parameters and arguments
primarily pincount= which can set the number of pins created for that instance (where applicable)

NAME

joyhandle — sets nonlinear joypad movements, deadbands and scales

SYNOPSIS

joyhandle

USAGE SYNOPSIS

loadrt joyhandle
OR
newinst joyhandle <newinstname> [ pincount=N | iprefix=prefix ] [instanceparamX=X | argX=X ]

( args in [ ] denote possible args and parameters, may not be used in all components )

DESCRIPTION

The component \fBjoyhandle\fR uses the following formula for a non linear joypad movements:

\fBy = (scale * (a*x^power + b*x)) + offset\fR

The parameters a and b are adjusted in such a way, that the function starts at (deadband,offset) and ends at (1,scale+offset).

Negative values will be treated point symetrically to origin. Values -deadband < x < +deadband will be set to zero.

Values x > 1 and x < -1 will be skipped to \(+-(scale+offset). Invert transforms the function to a progressive movement.

With power one can adjust the nonlinearity (default = 2). Default for deadband is 0.

Valid values are: power >= 1.0 (reasonable values are 1.x .. 4-5, take higher power-values for higher deadbands (>0.5), if you want to start with a nearly horizontal slope), 0 ⇐ deadband < 0.99 (reasonable 0.1).

An additional offset component can be set in special cases (default = 0).

All values can be adjusted for each instance separately.

FUNCTIONS

joyhandle.N.funct ( OR <newinstname>.funct (requires a floating-point thread) )

PINS

joyhandle.N.in float in ( OR <newinstname>.in float in )

joyhandle.N.out float out ( OR <newinstname>.out float out )

joyhandle.N.power float io (default: 2.0) ( OR <newinstname>.power float io (default: 2.0) )

joyhandle.N.deadband float io (default: 0.0) ( OR <newinstname>.deadband float io (default: 0.0) )

joyhandle.N.scale float io (default: 1.0) ( OR <newinstname>.scale float io (default: 1.0) )

joyhandle.N.offset float io (default: 0.0) ( OR <newinstname>.offset float io (default: 0.0) )

joyhandle.N.inverse bit io (default: false) ( OR <newinstname>.inverse bit io (default: false) )

LICENCE

GPL