d.tools: User Guide

Input and Output Components

The following types of components are currently supported by d.tools:

Input components

Input components sense user actions and generate events that describe those user actions to the d.tools application. Events have two functions: they can trigger transitions from one state to another in the interaction model; and they can serve as control signal sources for control connections to modify behavior of your prototype within an active state. d.tools supports two types of input components: discrete and continuous inputs.

Discrete input components have a fixed number of stages they can be in. The simplest kind of discrete input is a binary input which can only take on two values: on or off; 1 or 0. Buttons and switches are such binary discrete inputs. Discrete inputs can have more stages: 3-way switches or rotary encoders are examples. These components are not yet available in d.tools. To learn more about how discrete inputs trigger transitions, look at Pattern 1 in the page on d.tools design patterns.

Continuous input components have a range of values they can take on. In d.tools, the minimum value of a continuous controller is 0.0; the maximum value is 100.0. Sliders and knobs are examples of continuous inputs - turning a knob from its leftmost to its rightmost position will generate a long sequence of events with values starting at 0 , increasing, and ending at 100. Simple continuous controllers such as sliders and knobs operate in one range or dimension; other components can send multiple ranges of data. For example, an accelerometer transmits 3 dimensions of orientation data (X,Y and Z); a joystick transmits two dimensions (X and Y).
Continuous inputs can trigger state transitions by transforming the data values into discrete events. On a transition for a continuous input, you can specify an interval within 0.0 to 100.0. When the value received from the input component falls within the range, the transition is taken. For more information, see design pattern 4. Continuous inputs can also be used as control signal sources that send messages to control signal targets within a state. See the design pattern 7 for examples.

Button

Hardware component
Software representation
  • Transition Events in Statechart Editor
    (Properites of the Transition Arrow):
    • Button pressed
    • Button released
  • Discrete control signal sources :
    • Button Press
    • Button Release
    • Button Toggled?
  • Continuous control signal sources : none

A button can only be in one of two possible states at any point in time: either is is pressed down, or it is not pressed down. Buttons generate two types of events, whenever their state changes: when a button in up state is pressed down, a button_pressed event is generated. When a button in down state goes back up, a button_released event is generated. Buttons only stay pressed as long as the user is pushing them and then revert to their up state automatically. A key on a computer keyboard is an example of a button. A button is a binary discrete component.

 

Switch

Hardware component
Software representation
  • Transition Events in Statechart Editor
    (Properites of the Transition Arrow):
    • Switch toggled on
    • Switch toggled off
  • Discrete control signal sources :
    • Switch to On
    • Switch to Off
  • Continuous control signal sources : none

Like buttons, switches also have two possible states. Unlike buttons though, switches do not automatically toggle back to an initial state. The power switch on a surge protector is an example of this type of switch. A switch is a binary discrete component.

 

Slider

Hardware component
Software representation
  • Transition Events in Statechart Editor
    (Properites of the Transition Arrow):
    • Slider Changed
    • Slider Value in Range
  • Discrete control signal sources : none
  • Continuous control signal sources :
    • Slider Position

Sliders can transmit a range of values. In d.tools, input components that can transmit a range of values are called continuous controllers. In d.tools, the minimum value of a continuous controller is 0.0; the maximum value is 100.0.

 

Knob

Hardware component
Software representation
  • Transition Events in Statechart Editor
    (Properites of the Transition Arrow):
    • Knob Changed
    • Knob Value in Range
  • Discrete control signal sources : none
  • Continuous control signal sources :
    • Knob Position

Knobs behave like sliders, but their movement is rotational, rather than linear.

 

Accelerometer

Hardware component
Software representation
  • Transition Events in Statechart Editor
    (Properites of the Transition Arrow):
    • X-Axis Orientation Changed
    • X-Axis Orientation in Range
    • Y-Axis Orientation Changed
    • Y-Axis Orientation in Range
    • Z-Axis Orientation Changed
    • Z-Axis Orientation in Range
  • Discrete control signal sources : none
  • Continuous control signal sources :
    • X-Axis Orientation
    • Y-Axis Orientation
    • Z-Axis Orientation

Accelerometers can sense their orientation relative to the ground along three axes: X,Y and Z. Every time the physical component is moved or rotated, the new orientation is send as a value. An accelerometer is thus a 3-dimensional continuous controller.

Output components

Output components return information back to the user of your device. You author what kind of information (images, sounds, lights) will be sent to the user in each state of the statechart diagram. Whenever a new state is made the currently active state (either by selecting it with the mouse in the d.tool software or by events generated by hardware inputs), all outputs will change to reflect the authored content. Outputs also act as control signal targes within an active state.

LCD Display Screen

Hardware component
Software representation
  • Properties in Statechart Editor:
    • Screen image: filename of the image to be displayed. Can be typed in or assigned via drag and drop from the asset library.
  • Discrete control signal targets: none
  • Continuous control signal targets: none

LCD screens are output components that can display images in .gif, .jpg, and .png format. Drag and drop images from the d.tools Asset Library onto a software LCD screen icon in the statechart editor to show that image whenever the chosen state is active. This guide has a separate page that describes how to add your own images to d.tools to show on an LCD screen. Currently, d.tools supports only one LCD screen per device.

 

LED

Hardware component
Software representation
  • Properties in Statechart Editor:
    • LED on: sets whether the LED should be turned on or off when the state is entered.
  • Discrete control signal targets:
    • LED on/off : turns the LED on when 1 (or true/on/yes) is received and off when 0 (or false or off) is received.
  • Continuous control signal targets: none

LED stands for light emitting diode. Discrete control signals can turn LEDs on and off. Through the property sheet of an LED in a statechart state you can also define fading or blinking patterns.

 

Speaker

Hardware component
Software representation
  • Properties in Statechart Editor:
    • Soundfile: filename of the sound to be played. Can be typed in or assigned via drag and drop from the asset library.
    • Stop Previous Sound when Entering State: when set to "Yes", any sounds that may have been started before are stopped when the parent state of this speaker becomes active; when set to "No", sounds will keep on playing.
  • Discrete control signal targets:
    • Speaker mute: mutes the speaker when 1 (or true or on) is received and unmutes the speaker when 0 (or false or off) is received.
    • Volume up: increases the volume stepwise by 10% when 1 (or true or on) is received.
    • Volume down: decreases the volume by 10% when 1 (or true or on) is received.
  • Continuous control signal targets:
    • Speaker volume: sets the speaker volume to the value of the continuous controller (0 to 100%)

Speakers can play back sound files in .wav format. d.tools currently uses the sound card of your computer to play back the sound files so you do not have to embed a separate speaker into your device. Drag and drop sounds from the d.tools Asset Library onto speaker symbols in a state to assign a sound file to a state. Speakers can receive both continuous and discrete control signals.

 

Back to d.tools User Guide Overview