DISTANCE
Creating Sensors
const distance = hmSensor.createSensor(hmSensor.id.DISTANCE)
console.log(distance.current)
DISTANCE instance
distance: object
Properties | Description | Type |
---|---|---|
current | current mileage | number |
Registering sensor instance callback events
calorie.addEventListener(event, callback: Callback)
The events of CHANGE
The value of events
hmSensor.event.CHANGE
Callback
() => void
The example of events
distance.addEventListener(hmSensor.event.CHANGE, function () {
console.log('The current distance is ' + distance.current + '\r\n')
})