Skip to content
Rick Waldron edited this page Feb 3, 2015 · 19 revisions

The Joystick class constructs objects that represent a single Joystick sensor attached to the physical board.

This list will continue to be updated as more Joystick devices are confirmed.

Parameters

  • General Options
    Property Name Type Value(s) Description Default Required
    pins Array of Pins ["A*"] The String analog pins that X and Y none yes

Shape

{ 
  id: A user definable id value. Defaults to a generated uid
  pins: The pins defined for X and Y.
  x: -1, 1. READONLY
  y: -1, 1. READONLY
}

Component Initialization

var joystick = new five.Joystick({
  // [ x, y ]
  pins: ["A0", "A1"]
});

Joystick

Events

  • axismove Is an alias for "change".

  • change The "change" event is emitted whenever the value of the gyro changes more then the threshold value allows.

  • data The "data" event is fired as frequently as the user defined freq will allow in milliseconds. ("data" replaced the "read" event)

Clone this wiki locally