Driver Details

One Touch Button

By: My Device
Updated: Jan. 11, 2014
Version: 1.1

Version 1.1

This driver extends the normal functionality of a simple button to include:

  • Toggle Tracking
  • Paired buttons (mutually exclusive)
  • Short and Long press on a single button
  • Ramping Up/Down for controlling lighting systems
  • Custom Naming
  • Associated text variable

Detailed instructions (pdf) and sample project file included.

Version 1.1: Added license state variables.

Added Apex sample file to the download.

One Touch Driver

(c) 2013 My Device.

www.mydevice.com.au

This driver adds the ability to create buttons with multiple purposes including short and long press detection.

You can track (without using flags) up to 50 individual buttons that provide on/off, toggle and detection of a short and/or long button press. This is perfect for lighting systems where you can switch a circuit on/off and ramp the level up/down all from a single button! Check out the examples for how to do this.

My Device neither assumes nor accepts any liability for any loss, damage, theft, misuse, malfunction, etc. regardless of the cause or reason for any such event. My Device will not be liable for any damages (including but not limited to damages for loss of profits, business interruption or loss of information) arising out of the use of or inability to use the driver.

Note:

Please report any bugs found to bugs@mydevice.com.au. Include driver version number and steps to reproduce the issue where possible.

This driver requires ID 9.x as a minimum.

Driver Configuration Settings:

Settings:

Short Press Duration – When operating in short/long press detection mode this global value determines the minimum amount of time (in milliseconds) that a button must be held to trigger a long press event. 300ms seems to work well.

Number of buttons – Set the number of buttons that you require in your project (1 – 50). Setting this value will create a button entry for each one, including feedback and events.

Button Name – Label each button to help locate the correct one within a project.

Licensing:

Unlock code – Leave blank for a 60 minute trial. Once the trial expires, reboot your XP processor to start the 60 minute trial again. Entering a valid unlock code here removes this limitation.

Functions:

Please note that in all functions the ID of your buttons will only appear if you have correctly set the number of buttons in the configuration section (described above).

Button Push

This is used to indicate the user has pushed down on the button.

ID: Select the button name you wish to set the state of.

Button Release

This is used to indicate the user has released the previously pushed button.

ID: Select the button name you wish to set the state of.

Button Toggle

This is used to change the state of a button. That is, set it to OFF if it was ON and vice-versa.

ID: Select the button name you wish to set the state of.

Button On

This is used to indicate the state of a button is now ON.

ID: Select the button name you wish to set the state of.

Button Off

This is used to indicate the state of a button is now OFF.

ID: Select the button name you wish to set the state of.

Set Text

This is used to set a string variable associated with the button.

ID: Select the button name you wish to set the state of.

Text: The string you wish to set.

Variables:

Each button has the following feedback variables available:

On

This Boolean indicates the state of a toggle button.

Off

This Boolean indicates the negative state of a toggle button. Ie. When the On variable is true, Off will be false. This is useful when tracking On/Off across two buttons (see the examples).

Name

A string variable indicating the name you gave the button in the configuration section.

Text

A string variable of which you can set the text. Initially an empty string.

Direction

This Boolean indicates the current direction of a button. If the button is currently Off, then the direction will be Up (or TRUE). If the button is On, the direction will be Down (or FALSE). This is very useful when you wish to control a lighting system. Please see the example section.

Events:

On

This event triggers when the state of a button changes to On. It will not trigger if the button was already On.

Off

This event triggers when the state of a button changes to Off. It will not trigger if the button was already Off.

Ramp Up

This event triggers when a button has been held for a long push and the state was previously Off.

Ramp Down

This event triggers when a button has been held for a long push and the state was previously On.

Push

This event triggers when a short push has been detected.

Long Push

This event triggers when a long push has been detected (see short press duration in the configuration section).

Long Release

This event triggers when a button is released after a long push is detected.

A free license is available by clicking the Get License button above and entering your processor's MAC address.