Button

The button control is used to connect simple push buttons and switches to an input.  These appear as input buttons on the Generic HID device.  The devices can be toggle switches, or push button switches, either momentary, push-on-push-off, toggle, normally open, normally closed or what ever combination.

Most buttons will be mechanical devices, so a pull-up resistor will probably be needed.  See Mechanical Switches for more information.

A button can be connected to any I/O pin.

If the internal pull-up resistor is used (recommended), the switch can be wired directly between the Generic HID pin and ground.

Buttons are good for one or two input buttons.  However, each button will take up on I/O port.  If you have lots of button inputs, consider the Key Matrix.

Properties

Name

Components can be given an optional name.  This is seen in the Test tab. Not all applications support the name.  Hidcomp/hidconfig supports names.

UsagePage/Usage

The UsagePage and Usage of the Button. See Usages for more information.

A button will generally be classified in usage page "button".  The usage is then just a number.

Pull Up

Selecting this enables the internal pull-up resistor of the microcontroller. This is the normally setting. See Mechanical Switches for more information.

Debounce (ms)

Waits for the mechanical switch stop bouncing before registering a switch closure.  Enter the time to wait in milliseconds. See Mechanical Switches for more information.

Current

Defines the amount of electrical current used by the switch in mA. This is used to estimate the USB power draw.  See the section on Power for more information.

Current drawn by switches is usually insignificant and can be set to 0.