Joystick Bricklet 2.0

Features

  • 2-axis joystick with push-button

Description

The Joystick Bricklet 2.0 can be used to extend the features of Bricks by joystick functionality.

The Joystick is two directional and equipped with a push-button. You can read out the position of the stick (X/Y coordinates) and the state of the button.

With configurable events it is possible to react on changing positions and on button presses without polling.

Technical Specifications

Property

Value

Joystick

2-axis with push-button

Current Consumption

45mW (9mA at 5V)

X/Y Position

-100/100, 0=center

Dimensions (W x D x H)

25 x 45 x 23mm (0.98 x 1.77 x 0.9")*

Weight

15g

Resources

Test your Joystick Bricklet 2.0

To test a Joystick Bricklet 2.0 you need to have Brick Daemon and Brick Viewer installed. Brick Daemon acts as a proxy between the USB interface of the Bricks and the API bindings. Brick Viewer connects to Brick Daemon. It helps to figure out basic information about the connected Bricks and Bricklets and allows to test them.

Connect the Joystick Bricklet 2.0 to a Brick with a Bricklet Cable.

If you connect the Brick to the PC over USB, you should see a new tab named "Joystick Bricklet 2.0" in the Brick Viewer after a moment. Select this tab. If everything went as expected the Brick Viewer should look as depicted below.

Joystick Bricklet 2.0 in Brick Viewer

The tab consists of a coordinate system that shows the current position of the stick and if the button is pressed. Below this coordinate system you can find a graph that visualizes the movements over time. You should be able to reproduce the depicted graph when you move the stick first up, then down, then right and then end left.

If the Brick Viewer does not show "Position x=0, y=0" when the stick is in center position, press the "Calibrate Zero" button.

After this test you can go on with writing your own application. See the Programming Interface section for the API of the Joystick Bricklet 2.0 and examples in different programming languages.

Case

A laser-cut case for the Joystick Bricklet 2.0 is available.

Case for Joystick Bricklet 2.0

The assembly is easiest if you follow the following steps:

  • Screw spacers to the Bricklet,

  • screw bottom plate to bottom spacers,

  • build up side plates,

  • plug side plates into bottom plate and

  • screw top plate to top spacers.

Below you can see an exploded assembly drawing of the Joystick Bricklet 2.0 case:

Exploded assembly drawing for Joystick Bricklet 2.0

Hint: There is a protective film on both sides of the plates, you have to remove it before assembly.

Programming Interface

See Programming Interface for a detailed description.

Language

API

Examples

Installation

C/C++

API

Examples

Installation

C/C++ for Microcontrollers

API

Examples

Installation

C#

API

Examples

Installation

Delphi/Lazarus

API

Examples

Installation

Go

API

Examples

Installation

Java

API

Examples

Installation

JavaScript

API

Examples

Installation

LabVIEW

API

Installation

Mathematica

API

Examples

Installation

MATLAB/Octave

API

Examples

Installation

MQTT

API

Examples

Installation

openHAB

API

Examples

Installation

Perl

API

Examples

Installation

PHP

API

Examples

Installation

Python

API

Examples

Installation

Ruby

API

Examples

Installation

Rust

API

Examples

Installation

Shell

API

Examples

Installation

Visual Basic .NET

API

Examples

Installation

TCP/IP

API

Modbus

API