Connect IQ > APIメモ > Toybox > Sensor

下位ページ

Contents

Module: Toybox::Sensor


  • App Types : Widget, App
  • Requires Permission : Sensor

Defined Under Namespace

  • Classes: Info

Constant Summary

Remote system sensors that can be enabled

  • SENSOR_BIKESPEED = 0 : Since : 1.0.0
  • SENSOR_BIKECADENCE = 1 : Since : 1.0.0
  • SENSOR_BIKEPOWER = 2 : Since : 1.0.0
  • SENSOR_FOOTPOD = 3 : Since : 1.0.0
  • SENSOR_HEARTRATE = 4 : Since : 1.0.0
  • SENSOR_TEMPERATURE = 5 : Since : 1.0.0

Instance Method Summary

  • (Object) enableSensorEvents(listener) : Use enableSensorEvents() to request a sensor event.
  • (Sensor.Info) getInfo : Use getInfo() to retrieve the current Sensor.Info.
  • (Array) setEnabledSensors(sensors) : Use setEnabledSensors() to request system sensors.

Instance Method Details

(Object) enableSensorEvents(listener)


Use enableSensorEvents() to request a sensor event. This enables sensor events at 1Hz.
  • Parameters
    • listener (Method) : Method Object to call with sensor updates. Null for no listener
  • Since : 1.0.0

(Sensor.Info) getInfo

Use getInfo() to retrieve the current Sensor.Info
  • Returns : (Sensor.Info) object with current information.
  • Since : 1.0.0

(Array) setEnabledSensors(sensors)

Use setEnabledSensors() to request system sensors. This will also enable the system sensors if possible.
  • Parameters
    • sensors (Array) : Array of Sensor types to enable, or [] to disable all sensors
  • Returns : (Array) Array of requested sensors that were available
  • Since : 1.0.0
最終更新:2016年03月06日 23:13