Methods

public static

celsiusToFahrenheit(celsius)

Convert Celsius to Fahrenheit.

Parameter

Name Type Optional Description

celsius

 

 

Temperature in Celsius.

Returns

Temperature converted to Fahrenheit.

static

luxometerCallback(fun, interval)

Public. Set the luxometer notification callback.

Parameters

Name Type Optional Description

fun

 

 

success callback called repeatedly: fun(data)

interval

 

 

luxometer rate in milliseconds.

static

luxometerOff()

Public. Turn off luxometer notification.

static

luxometerOn()

Public. Turn on luxometer notification.

public

accelerometerCallback(fun, interval)

Public. Set the accelerometer notification callback.

Parameters

Name Type Optional Description

fun

 

 

success callback called repeatedly: fun(data)

interval

 

 

accelerometer rate in milliseconds.

public

accelerometerOff()

Public. Turn off accelerometer notification (SensorTag 1).

public

accelerometerOn()

Public. Turn on accelerometer notification (SensorTag 1).

public

barometerCallback(fun, interval)

Public. Set the barometer notification callback.

Parameters

Name Type Optional Description

fun

 

 

success callback called repeatedly: fun(data)

interval

 

 

barometer rate in milliseconds.

public

barometerOff()

Public. Turn off barometer notification.

public

barometerOn()

Public. Turn on barometer notification.

public

callErrorCallback()

Public. Call the error handler function.

public

callStatusCallback()

Public. Call the status handler function.

public

errorCallback(fun)

Public. Set the error handler function.

Parameter

Name Type Optional Description

fun

 

 

error callback: fun(error)

public

getDeviceModel()

Public. Get device model number.

public

getFirmwareString()

Public. Get firmware string.

public

gyroscopeCallback(fun, interval, axes)

Public. Set the gyroscope notification callback.

Parameters

Name Type Optional Description

fun

 

 

success callback called repeatedly: fun(data)

interval

 

 

gyroscope rate in milliseconds.

axes

 

 

(optional) the axes to enable ((z << 2) | (y << 1) | x) Only available on SensorTag CC2541. Axis parameter values are: 1 = X only, 2 = Y only, 3 = X and Y, 4 = Z only, 5 = X and Z, 6 = Y and Z, 7 = X, Y and Z.

public

gyroscopeOff()

Public. Turn off gyroscope notification (SensorTag 1).

public

gyroscopeOn()

Public. Turn on gyroscope notification (SensorTag 1).

public

humidityCallback(fun, interval)

Public. Set the humidity notification callback.

Parameters

Name Type Optional Description

fun

 

 

success callback called repeatedly: fun(data)

interval

 

 

humidity rate in milliseconds.

public

humidityOff()

Public. Turn off humidity notification.

public

humidityOn()

Public. Turn on humidity notification.

public

isAccelerometerAvailable()

Public. Checks if the accelerometer sensor is available.

public

isBarometerAvailable()

Public. Checks if the barometer sensor is available.

public

isGyroscopeAvailable()

Public. Checks if the gyroscope sensor is available.

public

isHumidityAvailable()

Public. Checks if the humidity sensor is available.

public

isKeypressAvailable()

Public. Checks if the keypress sensor is available.

public

isLuxometerAvailable()

Public. Checks if the luxometer sensor is available.

public

isMagnetometerAvailable()

Public. Checks if the magnetometer sensor is available.

public

isMovementAvailable()

Public. Checks if movement sensor is available that combines accelerometer, gyroscope, and magnetometer.

public

isTemperatureAvailable()

Public. Checks if the Temperature sensor is available.

public

keypressCallback(fun)

Public. Set the keypress notification callback.

Parameter

Name Type Optional Description

fun

 

 

success callback called when a key is pressed: fun(data)

public

keypressOff()

Public. Turn off keypress notification.

public

keypressOn()

Public. Turn on keypress notification.

public

magnetometerCallback(fun, interval)

Public. Set the magnetometer notification callback.

Parameters

Name Type Optional Description

fun

 

 

success callback called repeatedly: fun(data)

interval

 

 

magnetometer rate in milliseconds.

public

magnetometerOff()

Public. Turn off magnetometer notification (SensorTag 1).

public

magnetometerOn()

Public. Turn on magnetometer notification.

public

statusCallback(fun)

Public. Set the status handler function.

Parameter

Name Type Optional Description

fun

 

 

callback: fun(status)

public

temperatureCallback(fun, interval)

Public. Set the IR temperature notification callback.

Parameters

Name Type Optional Description

fun

 

 

success callback called repeatedly: fun(data)

interval

 

 

update rate in milliseconds (min 300ms)

public

temperatureOff()

Public. Turn off temperature notification.

public

temperatureOn()

Public. Turn on temperature notification.