Class: Distance

Distance()

Class representing a Distance TinkaTop

Constructor

new Distance()

Creates an instance of the Distance class
Source:

Extends

Methods

get_id() → {number}

Get the value of id. ID's are determined by the Tinkamo hardware protocol.
Overrides:
Source:
Returns:
Type
number

get_name() → {string}

Get the value of name
Overrides:
Source:
Returns:
Type
string

sense(command_id, command) → {number|boolean}

When distance of objects are in range, return a number, typically ranging from about 2 to 60. When the sensor becomes inaccurate due to objects lying at too great a distance, it sends a particular string of numbers that we interpret and return as false.
Parameters:
Name Type Description
command_id number
command Array.<number>
Overrides:
  • TinkaTop#sense
Source:
Returns:
Type
number | boolean