# Classes

##

### Classes

BoostMoveHub
ControlPlusHub
DuploTrainBase
Hub
LPF2Hub
PoweredUP
PUPHub
PUPRemote
WeDo2SmartHub

### Events

#### accel

  Emits when accelerometer detects movement. Measured in mG.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Inherited From:
    - LPF2Hub#event:accel
  Source:
    - lpf2hub.js, line 507

#### attach

  Emits when a motor or sensor is attached to the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `type` | DeviceType |

  Inherited From:
    - Hub#event:attach
  Overrides:
    - Hub#event:attach
  Source:
    - hub.js, line 237

#### button

  Emits when a button is pressed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `button` | string |
  `state` | ButtonState |

  Inherited From:
    - LPF2Hub#event:button
  Source:
    - lpf2hub.js, line 216

#### color

  Emits when a color sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |

  Inherited From:
    - LPF2Hub#event:color
  Source:
    - lpf2hub.js, line 408

#### colorAndDistance

  A combined color and distance event, emits when the sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |
  `distance` | number | Distance, in millimeters.

  Inherited From:
    - LPF2Hub#event:colorAndDistance
  Source:
    - lpf2hub.js, line 424

#### detach

  Emits when an attached motor or sensor is detached from the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |

  Inherited From:
    - Hub#event:detach
  Overrides:
    - Hub#event:detach
  Source:
    - hub.js, line 248

#### disconnect

  Emits when the hub is disconnected.

  Inherited From:
    - Hub#event:disconnect
  Overrides:
    - Hub#event:disconnect
  Source:
    - hub.js, line 39

#### distance

  Emits when a distance sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `distance` | number | Distance, in millimeters.

  Inherited From:
    - LPF2Hub#event:distance
  Source:
    - lpf2hub.js, line 398

#### gyro

  Emits when gyroscope detects movement. Measured in DPS - degrees per second.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Inherited From:
    - LPF2Hub#event:gyro
  Source:
    - lpf2hub.js, line 492

#### rotate

  Emits when a rotation sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `rotation` | number |

  Inherited From:
    - LPF2Hub#event:rotate
  Source:
    - lpf2hub.js, line 454

#### speed

  Emits on a speed change.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `speed` | number |

  Inherited From:
    - LPF2Hub#event:speed
  Source:
    - lpf2hub.js, line 554

#### temp

  Emits when a change is detected on a temperature sensor. Measured in degrees centigrade.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | For Control+ Hubs, port will be "CPU" as the sensor reports CPU temperature.
  `temp` | number |

  Inherited From:
    - LPF2Hub#event:temp
  Source:
    - lpf2hub.js, line 378

#### tilt

  Emits when a tilt sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | If the event is fired from the Move Hub or Control+ Hub's in-built tilt sensor, the special port "TILT" is used.
  `x` | number |
  `y` | number |
  `z` | number | (Only available when using a Control+ Hub)

  Inherited From:
    - LPF2Hub#event:tilt
  Source:
    - lpf2hub.js, line 441

#### accel

  Emits when accelerometer detects movement. Measured in mG.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Inherited From:
    - LPF2Hub#event:accel
  Source:
    - lpf2hub.js, line 507

#### attach

  Emits when a motor or sensor is attached to the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `type` | DeviceType |

  Inherited From:
    - Hub#event:attach
  Overrides:
    - Hub#event:attach
  Source:
    - hub.js, line 237

#### button

  Emits when a button is pressed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `button` | string |
  `state` | ButtonState |

  Inherited From:
    - LPF2Hub#event:button
  Source:
    - lpf2hub.js, line 216

#### color

  Emits when a color sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |

  Inherited From:
    - LPF2Hub#event:color
  Source:
    - lpf2hub.js, line 408

#### colorAndDistance

  A combined color and distance event, emits when the sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |
  `distance` | number | Distance, in millimeters.

  Inherited From:
    - LPF2Hub#event:colorAndDistance
  Source:
    - lpf2hub.js, line 424

#### detach

  Emits when an attached motor or sensor is detached from the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |

  Inherited From:
    - Hub#event:detach
  Overrides:
    - Hub#event:detach
  Source:
    - hub.js, line 248

#### disconnect

  Emits when the hub is disconnected.

  Inherited From:
    - Hub#event:disconnect
  Overrides:
    - Hub#event:disconnect
  Source:
    - hub.js, line 39

#### distance

  Emits when a distance sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `distance` | number | Distance, in millimeters.

  Inherited From:
    - LPF2Hub#event:distance
  Source:
    - lpf2hub.js, line 398

#### gyro

  Emits when gyroscope detects movement. Measured in DPS - degrees per second.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Inherited From:
    - LPF2Hub#event:gyro
  Source:
    - lpf2hub.js, line 492

#### rotate

  Emits when a rotation sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `rotation` | number |

  Inherited From:
    - LPF2Hub#event:rotate
  Source:
    - lpf2hub.js, line 454

#### speed

  Emits on a speed change.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `speed` | number |

  Inherited From:
    - LPF2Hub#event:speed
  Source:
    - lpf2hub.js, line 554

#### temp

  Emits when a change is detected on a temperature sensor. Measured in degrees centigrade.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | For Control+ Hubs, port will be "CPU" as the sensor reports CPU temperature.
  `temp` | number |

  Inherited From:
    - LPF2Hub#event:temp
  Source:
    - lpf2hub.js, line 378

#### tilt

  Emits when a tilt sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | If the event is fired from the Move Hub or Control+ Hub's in-built tilt sensor, the special port "TILT" is used.
  `x` | number |
  `y` | number |
  `z` | number | (Only available when using a Control+ Hub)

  Inherited From:
    - LPF2Hub#event:tilt
  Source:
    - lpf2hub.js, line 441

#### accel

  Emits when accelerometer detects movement. Measured in mG.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Inherited From:
    - LPF2Hub#event:accel
  Source:
    - lpf2hub.js, line 507

#### attach

  Emits when a motor or sensor is attached to the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `type` | DeviceType |

  Inherited From:
    - Hub#event:attach
  Overrides:
    - Hub#event:attach
  Source:
    - hub.js, line 237

#### button

  Emits when a button is pressed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `button` | string |
  `state` | ButtonState |

  Inherited From:
    - LPF2Hub#event:button
  Source:
    - lpf2hub.js, line 216

#### color

  Emits when a color sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |

  Inherited From:
    - LPF2Hub#event:color
  Source:
    - lpf2hub.js, line 408

#### colorAndDistance

  A combined color and distance event, emits when the sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |
  `distance` | number | Distance, in millimeters.

  Inherited From:
    - LPF2Hub#event:colorAndDistance
  Source:
    - lpf2hub.js, line 424

#### detach

  Emits when an attached motor or sensor is detached from the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |

  Inherited From:
    - Hub#event:detach
  Overrides:
    - Hub#event:detach
  Source:
    - hub.js, line 248

#### disconnect

  Emits when the hub is disconnected.

  Inherited From:
    - Hub#event:disconnect
  Overrides:
    - Hub#event:disconnect
  Source:
    - hub.js, line 39

#### distance

  Emits when a distance sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `distance` | number | Distance, in millimeters.

  Inherited From:
    - LPF2Hub#event:distance
  Source:
    - lpf2hub.js, line 398

#### gyro

  Emits when gyroscope detects movement. Measured in DPS - degrees per second.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Inherited From:
    - LPF2Hub#event:gyro
  Source:
    - lpf2hub.js, line 492

#### rotate

  Emits when a rotation sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `rotation` | number |

  Inherited From:
    - LPF2Hub#event:rotate
  Source:
    - lpf2hub.js, line 454

#### speed

  Emits on a speed change.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `speed` | number |

  Inherited From:
    - LPF2Hub#event:speed
  Source:
    - lpf2hub.js, line 554

#### temp

  Emits when a change is detected on a temperature sensor. Measured in degrees centigrade.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | For Control+ Hubs, port will be "CPU" as the sensor reports CPU temperature.
  `temp` | number |

  Inherited From:
    - LPF2Hub#event:temp
  Source:
    - lpf2hub.js, line 378

#### tilt

  Emits when a tilt sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | If the event is fired from the Move Hub or Control+ Hub's in-built tilt sensor, the special port "TILT" is used.
  `x` | number |
  `y` | number |
  `z` | number | (Only available when using a Control+ Hub)

  Inherited From:
    - LPF2Hub#event:tilt
  Source:
    - lpf2hub.js, line 441

#### attach

  Emits when a motor or sensor is attached to the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `type` | DeviceType |

  Source:
    - hub.js, line 237

#### detach

  Emits when an attached motor or sensor is detached from the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |

  Source:
    - hub.js, line 248

#### disconnect

  Emits when the hub is disconnected.

  Source:
    - hub.js, line 39

#### accel

  Emits when accelerometer detects movement. Measured in mG.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Source:
    - lpf2hub.js, line 507

#### attach

  Emits when a motor or sensor is attached to the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `type` | DeviceType |

  Inherited From:
    - Hub#event:attach
  Source:
    - hub.js, line 237

#### button

  Emits when a button is pressed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `button` | string |
  `state` | ButtonState |

  Source:
    - lpf2hub.js, line 216

#### color

  Emits when a color sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |

  Source:
    - lpf2hub.js, line 408

#### colorAndDistance

  A combined color and distance event, emits when the sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |
  `distance` | number | Distance, in millimeters.

  Source:
    - lpf2hub.js, line 424

#### detach

  Emits when an attached motor or sensor is detached from the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |

  Inherited From:
    - Hub#event:detach
  Source:
    - hub.js, line 248

#### disconnect

  Emits when the hub is disconnected.

  Inherited From:
    - Hub#event:disconnect
  Source:
    - hub.js, line 39

#### distance

  Emits when a distance sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `distance` | number | Distance, in millimeters.

  Source:
    - lpf2hub.js, line 398

#### gyro

  Emits when gyroscope detects movement. Measured in DPS - degrees per second.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Source:
    - lpf2hub.js, line 492

#### rotate

  Emits when a rotation sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `rotation` | number |

  Source:
    - lpf2hub.js, line 454

#### speed

  Emits on a speed change.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `speed` | number |

  Source:
    - lpf2hub.js, line 554

#### temp

  Emits when a change is detected on a temperature sensor. Measured in degrees centigrade.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | For Control+ Hubs, port will be "CPU" as the sensor reports CPU temperature.
  `temp` | number |

  Source:
    - lpf2hub.js, line 378

#### tilt

  Emits when a tilt sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | If the event is fired from the Move Hub or Control+ Hub's in-built tilt sensor, the special port "TILT" is used.
  `x` | number |
  `y` | number |
  `z` | number | (Only available when using a Control+ Hub)

  Source:
    - lpf2hub.js, line 441

#### discover

  Emits when a Powered UP Hub device is found.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `hub` | WeDo2SmartHub | BoostMoveHub | ControlPlusHub | PUPHub | PUPRemote | DuploTrainBase |

  Source:
    - poweredup-node.js, line 144

#### accel

  Emits when accelerometer detects movement. Measured in mG.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Inherited From:
    - LPF2Hub#event:accel
  Source:
    - lpf2hub.js, line 507

#### attach

  Emits when a motor or sensor is attached to the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `type` | DeviceType |

  Inherited From:
    - Hub#event:attach
  Overrides:
    - Hub#event:attach
  Source:
    - hub.js, line 237

#### button

  Emits when a button is pressed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `button` | string |
  `state` | ButtonState |

  Inherited From:
    - LPF2Hub#event:button
  Source:
    - lpf2hub.js, line 216

#### color

  Emits when a color sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |

  Inherited From:
    - LPF2Hub#event:color
  Source:
    - lpf2hub.js, line 408

#### colorAndDistance

  A combined color and distance event, emits when the sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |
  `distance` | number | Distance, in millimeters.

  Inherited From:
    - LPF2Hub#event:colorAndDistance
  Source:
    - lpf2hub.js, line 424

#### detach

  Emits when an attached motor or sensor is detached from the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |

  Inherited From:
    - Hub#event:detach
  Overrides:
    - Hub#event:detach
  Source:
    - hub.js, line 248

#### disconnect

  Emits when the hub is disconnected.

  Inherited From:
    - Hub#event:disconnect
  Overrides:
    - Hub#event:disconnect
  Source:
    - hub.js, line 39

#### distance

  Emits when a distance sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `distance` | number | Distance, in millimeters.

  Inherited From:
    - LPF2Hub#event:distance
  Source:
    - lpf2hub.js, line 398

#### gyro

  Emits when gyroscope detects movement. Measured in DPS - degrees per second.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Inherited From:
    - LPF2Hub#event:gyro
  Source:
    - lpf2hub.js, line 492

#### rotate

  Emits when a rotation sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `rotation` | number |

  Inherited From:
    - LPF2Hub#event:rotate
  Source:
    - lpf2hub.js, line 454

#### speed

  Emits on a speed change.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `speed` | number |

  Inherited From:
    - LPF2Hub#event:speed
  Source:
    - lpf2hub.js, line 554

#### temp

  Emits when a change is detected on a temperature sensor. Measured in degrees centigrade.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | For Control+ Hubs, port will be "CPU" as the sensor reports CPU temperature.
  `temp` | number |

  Inherited From:
    - LPF2Hub#event:temp
  Source:
    - lpf2hub.js, line 378

#### tilt

  Emits when a tilt sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | If the event is fired from the Move Hub or Control+ Hub's in-built tilt sensor, the special port "TILT" is used.
  `x` | number |
  `y` | number |
  `z` | number | (Only available when using a Control+ Hub)

  Inherited From:
    - LPF2Hub#event:tilt
  Source:
    - lpf2hub.js, line 441

#### accel

  Emits when accelerometer detects movement. Measured in mG.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Inherited From:
    - LPF2Hub#event:accel
  Source:
    - lpf2hub.js, line 507

#### attach

  Emits when a motor or sensor is attached to the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `type` | DeviceType |

  Inherited From:
    - Hub#event:attach
  Overrides:
    - Hub#event:attach
  Source:
    - hub.js, line 237

#### button

  Emits when a button is pressed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `button` | string |
  `state` | ButtonState |

  Inherited From:
    - LPF2Hub#event:button
  Source:
    - lpf2hub.js, line 216

#### color

  Emits when a color sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |

  Inherited From:
    - LPF2Hub#event:color
  Source:
    - lpf2hub.js, line 408

#### colorAndDistance

  A combined color and distance event, emits when the sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |
  `distance` | number | Distance, in millimeters.

  Inherited From:
    - LPF2Hub#event:colorAndDistance
  Source:
    - lpf2hub.js, line 424

#### detach

  Emits when an attached motor or sensor is detached from the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |

  Inherited From:
    - Hub#event:detach
  Overrides:
    - Hub#event:detach
  Source:
    - hub.js, line 248

#### disconnect

  Emits when the hub is disconnected.

  Inherited From:
    - Hub#event:disconnect
  Overrides:
    - Hub#event:disconnect
  Source:
    - hub.js, line 39

#### distance

  Emits when a distance sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `distance` | number | Distance, in millimeters.

  Inherited From:
    - LPF2Hub#event:distance
  Source:
    - lpf2hub.js, line 398

#### gyro

  Emits when gyroscope detects movement. Measured in DPS - degrees per second.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |
  `z` | number |

  Inherited From:
    - LPF2Hub#event:gyro
  Source:
    - lpf2hub.js, line 492

#### rotate

  Emits when a rotation sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `rotation` | number |

  Inherited From:
    - LPF2Hub#event:rotate
  Source:
    - lpf2hub.js, line 454

#### speed

  Emits on a speed change.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `speed` | number |

  Inherited From:
    - LPF2Hub#event:speed
  Source:
    - lpf2hub.js, line 554

#### temp

  Emits when a change is detected on a temperature sensor. Measured in degrees centigrade.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | For Control+ Hubs, port will be "CPU" as the sensor reports CPU temperature.
  `temp` | number |

  Inherited From:
    - LPF2Hub#event:temp
  Source:
    - lpf2hub.js, line 378

#### tilt

  Emits when a tilt sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string | If the event is fired from the Move Hub or Control+ Hub's in-built tilt sensor, the special port "TILT" is used.
  `x` | number |
  `y` | number |
  `z` | number | (Only available when using a Control+ Hub)

  Inherited From:
    - LPF2Hub#event:tilt
  Source:
    - lpf2hub.js, line 441

#### attach

  Emits when a motor or sensor is attached to the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `type` | DeviceType |

  Inherited From:
    - Hub#event:attach
  Source:
    - hub.js, line 237

#### button

  Emits when a button is pressed.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `button` | string |
  `state` | ButtonState |

  Source:
    - wedo2smarthub.js, line 318

#### color

  Emits when a color sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `color` | Color |

  Source:
    - wedo2smarthub.js, line 363

#### detach

  Emits when an attached motor or sensor is detached from the Hub.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |

  Inherited From:
    - Hub#event:detach
  Source:
    - hub.js, line 248

#### disconnect

  Emits when the hub is disconnected.

  Inherited From:
    - Hub#event:disconnect
  Source:
    - hub.js, line 39

#### distance

  Emits when a distance sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `distance` | number | Distance, in millimeters.

  Source:
    - wedo2smarthub.js, line 352

#### rotate

  Emits when a rotation sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `rotation` | number |

  Source:
    - wedo2smarthub.js, line 387

#### tilt

  Emits when a tilt sensor is activated.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `port` | string |
  `x` | number |
  `y` | number |

  Source:
    - wedo2smarthub.js, line 375

#### Search results