DPad

DPad

A digital directional input device for your gadget, which returns what directions are being pressed.

Similar to the Analog Stick in functionality.

Properties

X number read only

The position of the pad along the horizontal axis, only returns -100 or 100 when pressed, 0 when not.

Y number read only

The position of the pad along the vertical axis, only returns -100 or 100 when pressed, 0 when not.

InputSourceX InputSource

The module associated with the stick's horizontal axis. See InputSource for more info.

InputSourceY InputSource

The module associated with the stick's vertical axis. See InputSource for more info.

Events

DPadValueChangeEvent : { X number, Y number, Type string }

Triggered when the D-Pad is pressed.
* X and Y are the respective values of the pad
* Type is "DPadValueChangeEvent"

In the Multitool

You can set the InputSource properties from the Multitool while editing your gadget to set these values without using code.

Examples

See the Collect the Dot cookbook example for an example on how to address individual LEDs in the matrix with D-Pad input.